summaryrefslogtreecommitdiff
path: root/test/e2e/rootless_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/rootless_test.go')
-rw-r--r--test/e2e/rootless_test.go23
1 files changed, 19 insertions, 4 deletions
diff --git a/test/e2e/rootless_test.go b/test/e2e/rootless_test.go
index aa8ed6faa..51544ff8b 100644
--- a/test/e2e/rootless_test.go
+++ b/test/e2e/rootless_test.go
@@ -38,6 +38,7 @@ var _ = Describe("Podman rootless", func() {
)
BeforeEach(func() {
+ SkipIfRootless()
tempdir, err = CreateTempDirInTempDir()
if err != nil {
os.Exit(1)
@@ -45,14 +46,15 @@ var _ = Describe("Podman rootless", func() {
podmanTest = PodmanTestCreate(tempdir)
podmanTest.CgroupManager = "cgroupfs"
podmanTest.StorageOptions = ROOTLESS_STORAGE_OPTIONS
+ podmanTest.Setup()
podmanTest.RestoreAllArtifacts()
})
AfterEach(func() {
podmanTest.Cleanup()
f := CurrentGinkgoTestDescription()
- timedResult := fmt.Sprintf("Test: %s completed in %f seconds", f.TestText, f.Duration.Seconds())
- GinkgoWriter.Write([]byte(timedResult))
+ processTestResult(f)
+
})
It("podman rootless help|version", func() {
@@ -125,7 +127,6 @@ var _ = Describe("Podman rootless", func() {
env := os.Environ()
env = append(env, fmt.Sprintf("XDG_RUNTIME_DIR=%s", xdgRuntimeDir))
env = append(env, fmt.Sprintf("HOME=%s", home))
- env = append(env, "PODMAN_ALLOW_SINGLE_ID_MAPPING_IN_USERNS=1")
env = append(env, "USER=foo")
cmd := rootlessTest.PodmanAsUser([]string{"pod", "create", "--infra=false"}, 1000, 1000, "", env)
@@ -138,6 +139,21 @@ var _ = Describe("Podman rootless", func() {
cmd.WaitWithDefaultTimeout()
Expect(cmd.ExitCode()).To(Equal(0))
Expect(cmd.LineInOutputContains("hello")).To(BeTrue())
+
+ args = []string{"pod", "top", podId}
+ cmd = rootlessTest.PodmanAsUser(args, 1000, 1000, "", env)
+ cmd.WaitWithDefaultTimeout()
+ Expect(cmd.ExitCode()).To(Not(Equal(0)))
+
+ args = []string{"run", "--pod", podId, "-d", "--rootfs", mountPath, "sleep", "100"}
+ cmd = rootlessTest.PodmanAsUser(args, 1000, 1000, "", env)
+ cmd.WaitWithDefaultTimeout()
+ Expect(cmd.ExitCode()).To(Equal(0))
+
+ args = []string{"pod", "top", podId}
+ cmd = rootlessTest.PodmanAsUser(args, 1000, 1000, "", env)
+ cmd.WaitWithDefaultTimeout()
+ Expect(cmd.ExitCode()).To(Equal(0))
}
runInRootlessContext(f)
})
@@ -170,7 +186,6 @@ var _ = Describe("Podman rootless", func() {
env := os.Environ()
env = append(env, fmt.Sprintf("XDG_RUNTIME_DIR=%s", xdgRuntimeDir))
env = append(env, fmt.Sprintf("HOME=%s", home))
- env = append(env, "PODMAN_ALLOW_SINGLE_ID_MAPPING_IN_USERNS=1")
env = append(env, "USER=foo")
allArgs := append([]string{"run"}, args...)