diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2018-09-17 07:58:34 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-09-17 16:55:11 +0000 |
commit | 28a2bf827ae9f592ddd9e5c11277606d32cf329c (patch) | |
tree | c0475d42671eae515fc930f1950097e0d0781ee9 /test | |
parent | 800eb8633850ddbcd01aa827fe4e505e6075e253 (diff) | |
download | podman-28a2bf827ae9f592ddd9e5c11277606d32cf329c.tar.gz podman-28a2bf827ae9f592ddd9e5c11277606d32cf329c.tar.bz2 podman-28a2bf827ae9f592ddd9e5c11277606d32cf329c.zip |
Add new tests for ipc namespace sharing
We seem to be having a few flakes on namespace sharing.
Adding this test to make sure sharing with the host is working correctly.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Closes: #1485
Approved by: mheon
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 a61b4ab03..88c0b1ad2 100644 --- a/test/e2e/run_ns_test.go +++ b/test/e2e/run_ns_test.go @@ -3,6 +3,7 @@ package integration import ( "fmt" "os" + "strings" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -59,6 +60,36 @@ var _ = Describe("Podman run ns", func() { Expect(session.OutputToString()).To(Equal(hostShm)) }) + It("podman run ipcns ipcmk host test", func() { + setup := podmanTest.SystemExec("ipcmk", []string{"-M", "1024"}) + setup.WaitWithDefaultTimeout() + Expect(setup.ExitCode()).To(Equal(0)) + output := strings.Split(setup.OutputToString(), " ") + ipc := output[len(output)-1] + session := podmanTest.Podman([]string{"run", "--ipc=host", fedoraMinimal, "ipcs", "-m", "-i", ipc}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + + setup = podmanTest.SystemExec("ipcrm", []string{"-m", ipc}) + setup.WaitWithDefaultTimeout() + Expect(setup.ExitCode()).To(Equal(0)) + }) + + It("podman run ipcns ipcmk container test", func() { + setup := podmanTest.Podman([]string{"run", "-d", "--name", "test1", fedoraMinimal, "sleep", "999"}) + setup.WaitWithDefaultTimeout() + Expect(setup.ExitCode()).To(Equal(0)) + + session := podmanTest.Podman([]string{"exec", "test1", "ipcmk", "-M", "1024"}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + output := strings.Split(session.OutputToString(), " ") + ipc := output[len(output)-1] + session = podmanTest.Podman([]string{"run", "--ipc=container:test1", fedoraMinimal, "ipcs", "-m", "-i", ipc}) + session.WaitWithDefaultTimeout() + Expect(session.ExitCode()).To(Equal(0)) + }) + It("podman run bad ipc pid test", func() { session := podmanTest.Podman([]string{"run", "--ipc=badpid", fedoraMinimal, "bash", "-c", "echo $$"}) session.WaitWithDefaultTimeout() |