mirror of
https://github.com/containers/podman.git
synced 2025-06-23 02:18:13 +08:00
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
This commit is contained in:

committed by
Atomic Bot

parent
800eb86338
commit
28a2bf827a
@ -3,6 +3,7 @@ package integration
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
@ -59,6 +60,36 @@ var _ = Describe("Podman run ns", func() {
|
|||||||
Expect(session.OutputToString()).To(Equal(hostShm))
|
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() {
|
It("podman run bad ipc pid test", func() {
|
||||||
session := podmanTest.Podman([]string{"run", "--ipc=badpid", fedoraMinimal, "bash", "-c", "echo $$"})
|
session := podmanTest.Podman([]string{"run", "--ipc=badpid", fedoraMinimal, "bash", "-c", "echo $$"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
|
Reference in New Issue
Block a user