summaryrefslogtreecommitdiff
path: root/test/e2e/pod_rm_test.go
diff options
context:
space:
mode:
authorhaircommander <pehunt@redhat.com>2018-07-27 13:58:50 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-23 18:16:28 +0000
commitd5e690914dc78eca8664442e7677eb5004522bfd (patch)
tree3f7ed30e4302c871c16126a0032b8a3d51c46f98 /test/e2e/pod_rm_test.go
parent63dd200e7e47261454c7e55fed2ad972144e147f (diff)
downloadpodman-d5e690914dc78eca8664442e7677eb5004522bfd.tar.gz
podman-d5e690914dc78eca8664442e7677eb5004522bfd.tar.bz2
podman-d5e690914dc78eca8664442e7677eb5004522bfd.zip
Added option to share kernel namespaces in libpod and podman
A pause container is added to the pod if the user opts in. The default pause image and command can be overridden. Pause containers are ignored in ps unless the -a option is present. Pod inspect and pod ps show shared namespaces and pause container. A pause container can't be removed with podman rm, and a pod can be removed if it only has a pause container. Signed-off-by: haircommander <pehunt@redhat.com> Closes: #1187 Approved by: mheon
Diffstat (limited to 'test/e2e/pod_rm_test.go')
-rw-r--r--test/e2e/pod_rm_test.go72
1 files changed, 29 insertions, 43 deletions
diff --git a/test/e2e/pod_rm_test.go b/test/e2e/pod_rm_test.go
index 1ce0d18c7..09002e954 100644
--- a/test/e2e/pod_rm_test.go
+++ b/test/e2e/pod_rm_test.go
@@ -32,9 +32,8 @@ var _ = Describe("Podman pod rm", func() {
})
It("podman pod rm empty pod", func() {
- session := podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
- podid := session.OutputToString()
+ _, ec, podid := podmanTest.CreatePod("")
+ Expect(ec).To(Equal(0))
result := podmanTest.Podman([]string{"pod", "rm", podid})
result.WaitWithDefaultTimeout()
@@ -42,13 +41,11 @@ var _ = Describe("Podman pod rm", func() {
})
It("podman pod rm latest pod", func() {
- session := podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
- podid := session.OutputToString()
+ _, ec, podid := podmanTest.CreatePod("")
+ Expect(ec).To(Equal(0))
- session = podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
- podid2 := session.OutputToString()
+ _, ec2, podid2 := podmanTest.CreatePod("")
+ Expect(ec2).To(Equal(0))
result := podmanTest.Podman([]string{"pod", "rm", "--latest"})
result.WaitWithDefaultTimeout()
@@ -62,14 +59,11 @@ var _ = Describe("Podman pod rm", func() {
})
It("podman pod rm doesn't remove a pod with a container", func() {
- session := podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
-
- podid := session.OutputToString()
+ _, ec, podid := podmanTest.CreatePod("")
+ Expect(ec).To(Equal(0))
- session = podmanTest.Podman([]string{"create", "--pod", podid, ALPINE, "ls"})
- session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
+ _, ec2, _ := podmanTest.RunLsContainerInPod("", podid)
+ Expect(ec2).To(Equal(0))
result := podmanTest.Podman([]string{"pod", "rm", podid})
result.WaitWithDefaultTimeout()
@@ -81,12 +75,10 @@ var _ = Describe("Podman pod rm", func() {
})
It("podman pod rm -f does remove a running container", func() {
- session := podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
+ _, ec, podid := podmanTest.CreatePod("")
+ Expect(ec).To(Equal(0))
- podid := session.OutputToString()
-
- session = podmanTest.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top"})
+ session := podmanTest.RunTopContainerInPod("", podid)
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -100,15 +92,13 @@ var _ = Describe("Podman pod rm", func() {
})
It("podman pod rm -a doesn't remove a running container", func() {
- session := podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
+ _, ec, podid1 := podmanTest.CreatePod("")
+ Expect(ec).To(Equal(0))
- podid1 := session.OutputToString()
+ _, ec, _ = podmanTest.CreatePod("")
+ Expect(ec).To(Equal(0))
- session = podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
-
- session = podmanTest.Podman([]string{"run", "-d", "--pod", podid1, ALPINE, "top"})
+ session := podmanTest.RunTopContainerInPod("", podid1)
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -127,20 +117,16 @@ var _ = Describe("Podman pod rm", func() {
})
It("podman pod rm -fa removes everything", func() {
- session := podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
-
- podid1 := session.OutputToString()
-
- session = podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
+ _, ec, podid1 := podmanTest.CreatePod("")
+ Expect(ec).To(Equal(0))
- podid2 := session.OutputToString()
+ _, ec, podid2 := podmanTest.CreatePod("")
+ Expect(ec).To(Equal(0))
- session = podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
+ _, ec, _ = podmanTest.CreatePod("")
+ Expect(ec).To(Equal(0))
- session = podmanTest.Podman([]string{"run", "-d", "--pod", podid1, ALPINE, "top"})
+ session := podmanTest.RunTopContainerInPod("", podid1)
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -148,12 +134,12 @@ var _ = Describe("Podman pod rm", func() {
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"run", "-d", "--pod", podid2, ALPINE, "ls"})
- session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
+ _, ec, _ = podmanTest.RunLsContainerInPod("", podid2)
+ Expect(ec).To(Equal(0))
- session = podmanTest.Podman([]string{"run", "-d", "--pod", podid2, ALPINE, "top"})
+ session = podmanTest.RunTopContainerInPod("", podid2)
session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
result := podmanTest.Podman([]string{"pod", "rm", "-fa"})
result.WaitWithDefaultTimeout()