diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2018-08-22 17:45:44 +0200 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-08-22 20:32:27 +0000 |
commit | 4a95ef4a4e88e1563a89e2384b1545c361a46d26 (patch) | |
tree | f7ed13d92669884639264137cc9f510dd99b7c2b /test/e2e/rootless_test.go | |
parent | 77bcc89d526745b2e0d17d94974990a134908751 (diff) | |
download | podman-4a95ef4a4e88e1563a89e2384b1545c361a46d26.tar.gz podman-4a95ef4a4e88e1563a89e2384b1545c361a46d26.tar.bz2 podman-4a95ef4a4e88e1563a89e2384b1545c361a46d26.zip |
test: ad more tests for rootless containers
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #1323
Approved by: umohnani8
Diffstat (limited to 'test/e2e/rootless_test.go')
-rw-r--r-- | test/e2e/rootless_test.go | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/test/e2e/rootless_test.go b/test/e2e/rootless_test.go index 9737b9a09..f77ad9924 100644 --- a/test/e2e/rootless_test.go +++ b/test/e2e/rootless_test.go @@ -44,7 +44,7 @@ var _ = Describe("Podman rootless", func() { } }) - It("podman rootless rootfs", func() { + runRootless := func(args []string) { // Check if we can create an user namespace err := exec.Command("unshare", "-r", "echo", "hello").Run() if err != nil { @@ -96,7 +96,9 @@ var _ = Describe("Podman rootless", func() { 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") - cmd := podmanTest.PodmanAsUser([]string{"run", "--rootfs", mountPath, "echo", "hello"}, 1000, 1000, env) + allArgs := append([]string{"run"}, args...) + allArgs = append(allArgs, "--rootfs", mountPath, "echo", "hello") + cmd := podmanTest.PodmanAsUser(allArgs, 1000, 1000, env) cmd.WaitWithDefaultTimeout() Expect(cmd.LineInOutputContains("hello")).To(BeTrue()) Expect(cmd.ExitCode()).To(Equal(0)) @@ -107,5 +109,21 @@ var _ = Describe("Podman rootless", func() { umount := podmanTest.Podman([]string{"umount", cid}) umount.WaitWithDefaultTimeout() Expect(umount.ExitCode()).To(Equal(0)) + } + + It("podman rootless rootfs", func() { + runRootless([]string{}) + }) + + It("podman rootless rootfs --net host", func() { + runRootless([]string{"--net", "host"}) + }) + + It("podman rootless rootfs --privileged", func() { + runRootless([]string{"--privileged"}) + }) + + It("podman rootless rootfs --net host --privileged", func() { + runRootless([]string{"--net", "host", "--privileged"}) }) }) |