mirror of
https://github.com/containers/podman.git
synced 2025-12-10 07:42:12 +08:00
Only allow Rootless runs of Podman Machine
Podman Machine crashes if run as root. When creating the machine, we write the ignition so that the UID of the core user matches the UID of the user on the host. We by default, create the root user on the machine with UID 0. If the user on the host is root, the core UID and the Root UID collide, causing a the VM not to boot. [NO NEW TESTS NEEDED] Signed-off-by: Ashley Cui <acui@redhat.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/containers/podman/v4/pkg/rootless"
|
||||
. "github.com/containers/podman/v4/test/utils"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
@@ -92,9 +93,12 @@ var _ = Describe("podman system reset", func() {
|
||||
|
||||
// TODO: machine tests currently don't run outside of the machine test pkg
|
||||
// no machines are created here to cleanup
|
||||
session = podmanTest.Podman([]string{"machine", "list", "-q"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session.OutputToStringArray()).To(BeEmpty())
|
||||
// machine commands are rootless only
|
||||
if rootless.IsRootless() {
|
||||
session = podmanTest.Podman([]string{"machine", "list", "-q"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).Should(Exit(0))
|
||||
Expect(session.OutputToStringArray()).To(BeEmpty())
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user