diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-04-09 01:36:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-09 01:36:53 -0700 |
commit | d744d9e3038aea2cf77ca83326be2f141da3b610 (patch) | |
tree | a407b434cdd1cc67a66f2983fbadbfe3e6dfcacd /test/e2e/run_userns_test.go | |
parent | 0fdbf1d306a806520257e100bb9f306e516fd8f0 (diff) | |
parent | ce82e19a372571f296e8463727809ee76c725911 (diff) | |
download | podman-d744d9e3038aea2cf77ca83326be2f141da3b610.tar.gz podman-d744d9e3038aea2cf77ca83326be2f141da3b610.tar.bz2 podman-d744d9e3038aea2cf77ca83326be2f141da3b610.zip |
Merge pull request #2859 from giuseppe/enable-userns-tests-rootless
test: enable userns and remote e2e tests for rootless
Diffstat (limited to 'test/e2e/run_userns_test.go')
-rw-r--r-- | test/e2e/run_userns_test.go | 42 |
1 files changed, 10 insertions, 32 deletions
diff --git a/test/e2e/run_userns_test.go b/test/e2e/run_userns_test.go index 5c38a8950..f7f0e1c9a 100644 --- a/test/e2e/run_userns_test.go +++ b/test/e2e/run_userns_test.go @@ -18,7 +18,12 @@ var _ = Describe("Podman UserNS support", func() { ) BeforeEach(func() { - SkipIfRootless() + if os.Getenv("SKIP_USERNS") != "" { + Skip("Skip userns tests.") + } + if _, err := os.Stat("/proc/self/uid_map"); err != nil { + Skip("User namespaces not supported.") + } tempdir, err = CreateTempDirInTempDir() if err != nil { os.Exit(1) @@ -36,14 +41,7 @@ var _ = Describe("Podman UserNS support", func() { }) It("podman uidmapping and gidmapping", func() { - if os.Getenv("SKIP_USERNS") != "" { - Skip("Skip userns tests.") - } - if _, err := os.Stat("/proc/self/uid_map"); err != nil { - Skip("User namespaces not supported.") - } - - session := podmanTest.Podman([]string{"run", "--uidmap=0:1:70000", "--gidmap=0:20000:70000", "busybox", "echo", "hello"}) + session := podmanTest.Podman([]string{"run", "--uidmap=0:100:5000", "--gidmap=0:200:5000", "alpine", "echo", "hello"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) ok, _ := session.GrepString("hello") @@ -55,14 +53,7 @@ var _ = Describe("Podman UserNS support", func() { // https://github.com/containers/libpod/pull/1066#issuecomment-403562116 // To avoid a potential future regression, use this as a test. It("podman uidmapping and gidmapping with short-opts", func() { - if os.Getenv("SKIP_USERNS") != "" { - Skip("Skip userns tests.") - } - if _, err := os.Stat("/proc/self/uid_map"); err != nil { - Skip("User namespaces not supported.") - } - - session := podmanTest.Podman([]string{"run", "--uidmap=0:1:70000", "--gidmap=0:20000:70000", "-it", "busybox", "echo", "hello"}) + session := podmanTest.Podman([]string{"run", "--uidmap=0:1:5000", "--gidmap=0:200:5000", "-it", "alpine", "echo", "hello"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) ok, _ := session.GrepString("hello") @@ -70,14 +61,7 @@ var _ = Describe("Podman UserNS support", func() { }) It("podman uidmapping and gidmapping with a volume", func() { - if os.Getenv("SKIP_USERNS") != "" { - Skip("Skip userns tests.") - } - if _, err := os.Stat("/proc/self/uid_map"); err != nil { - Skip("User namespaces not supported.") - } - - session := podmanTest.Podman([]string{"run", "--uidmap=0:1:70000", "--gidmap=0:20000:70000", "-v", "my-foo-volume:/foo:Z", "busybox", "echo", "hello"}) + session := podmanTest.Podman([]string{"run", "--uidmap=0:1:500", "--gidmap=0:200:5000", "-v", "my-foo-volume:/foo:Z", "alpine", "echo", "hello"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) ok, _ := session.GrepString("hello") @@ -85,13 +69,7 @@ var _ = Describe("Podman UserNS support", func() { }) It("podman uidmapping and gidmapping --net=host", func() { - if os.Getenv("SKIP_USERNS") != "" { - Skip("Skip userns tests.") - } - if _, err := os.Stat("/proc/self/uid_map"); err != nil { - Skip("User namespaces not supported.") - } - session := podmanTest.Podman([]string{"run", "--net=host", "--uidmap=0:1:70000", "--gidmap=0:20000:70000", "busybox", "echo", "hello"}) + session := podmanTest.Podman([]string{"run", "--net=host", "--uidmap=0:1:5000", "--gidmap=0:200:5000", "alpine", "echo", "hello"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) ok, _ := session.GrepString("hello") |