diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-07-28 18:40:54 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-28 18:40:54 -0400 |
commit | 539bb4c59208c9369cb034aa458b3ba89b8bdd3b (patch) | |
tree | dcf62d5d3d545d8d31401a996e1b7159e77f763c /test | |
parent | b0777adcacef2f568ea68af81e6889d4cbdc3e0f (diff) | |
parent | bb4d269087d11623e15d1aa3c8cb197f29a601d1 (diff) | |
download | podman-539bb4c59208c9369cb034aa458b3ba89b8bdd3b.tar.gz podman-539bb4c59208c9369cb034aa458b3ba89b8bdd3b.tar.bz2 podman-539bb4c59208c9369cb034aa458b3ba89b8bdd3b.zip |
Merge pull request #7109 from rhatdan/ipc
Specifying --ipc=host --pid=host is broken
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/run_ns_test.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/e2e/run_ns_test.go b/test/e2e/run_ns_test.go index 2b6da2888..5242e04d2 100644 --- a/test/e2e/run_ns_test.go +++ b/test/e2e/run_ns_test.go @@ -2,6 +2,7 @@ package integration import ( "os" + "os/exec" "strings" . "github.com/containers/podman/v2/test/utils" @@ -102,4 +103,34 @@ var _ = Describe("Podman run ns", func() { session.WaitWithDefaultTimeout() Expect(session).To(ExitWithError()) }) + + It("podman run --ipc=host --pid=host", func() { + cmd := exec.Command("ls", "-l", "/proc/self/ns/pid") + res, err := cmd.Output() + Expect(err).To(BeNil()) + fields := strings.Split(string(res), " ") + hostPidNS := strings.TrimSuffix(fields[len(fields)-1], "\n") + + cmd = exec.Command("ls", "-l", "/proc/self/ns/ipc") + res, err = cmd.Output() + Expect(err).To(BeNil()) + fields = strings.Split(string(res), " ") + hostIpcNS := strings.TrimSuffix(fields[len(fields)-1], "\n") + + session := podmanTest.Podman([]string{"run", "--ipc=host", "--pid=host", ALPINE, "ls", "-l", "/proc/self/ns/pid"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + fields = strings.Split(session.OutputToString(), " ") + ctrPidNS := strings.TrimSuffix(fields[len(fields)-1], "\n") + + session = podmanTest.Podman([]string{"run", "--ipc=host", "--pid=host", ALPINE, "ls", "-l", "/proc/self/ns/ipc"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + fields = strings.Split(session.OutputToString(), " ") + ctrIpcNS := strings.TrimSuffix(fields[len(fields)-1], "\n") + + Expect(hostPidNS).To(Equal(ctrPidNS)) + Expect(hostIpcNS).To(Equal(ctrIpcNS)) + }) + }) |