summaryrefslogtreecommitdiff
path: root/test/e2e/pod_ps_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_ps_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_ps_test.go')
-rw-r--r--test/e2e/pod_ps_test.go98
1 files changed, 37 insertions, 61 deletions
diff --git a/test/e2e/pod_ps_test.go b/test/e2e/pod_ps_test.go
index 4e2995917..b48cb9578 100644
--- a/test/e2e/pod_ps_test.go
+++ b/test/e2e/pod_ps_test.go
@@ -39,12 +39,10 @@ var _ = Describe("Podman ps", func() {
})
It("podman pod ps default", func() {
- session := podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
+ _, ec, podid := podmanTest.CreatePod("")
+ Expect(ec).To(Equal(0))
- podid := session.OutputToString()
- session = podmanTest.RunTopContainerInPod("", podid)
+ session := podmanTest.RunTopContainerInPod("", podid)
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -55,12 +53,10 @@ var _ = Describe("Podman ps", func() {
})
It("podman pod ps quiet flag", func() {
- session := podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
+ _, ec, podid := podmanTest.CreatePod("")
+ Expect(ec).To(Equal(0))
- podid := session.OutputToString()
- _, ec, _ := podmanTest.RunLsContainerInPod("", podid)
+ _, ec, _ = podmanTest.RunLsContainerInPod("", podid)
Expect(ec).To(Equal(0))
result := podmanTest.Podman([]string{"pod", "ps", "-q"})
@@ -71,14 +67,12 @@ var _ = Describe("Podman ps", func() {
})
It("podman pod ps no-trunc", func() {
- session := podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
-
- podid := session.OutputToString()
- _, ec, _ := podmanTest.RunLsContainerInPod("", podid)
+ _, ec, podid := podmanTest.CreatePod("")
Expect(ec).To(Equal(0))
+ _, ec2, _ := podmanTest.RunLsContainerInPod("", podid)
+ Expect(ec2).To(Equal(0))
+
result := podmanTest.Podman([]string{"pod", "ps", "-q", "--no-trunc"})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))
@@ -87,17 +81,11 @@ var _ = Describe("Podman ps", func() {
})
It("podman pod ps latest", func() {
- session := podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
-
- podid1 := session.OutputToString()
-
- session = podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
+ _, ec, podid1 := podmanTest.CreatePod("")
+ Expect(ec).To(Equal(0))
- podid2 := session.OutputToString()
+ _, ec2, podid2 := podmanTest.CreatePod("")
+ Expect(ec2).To(Equal(0))
result := podmanTest.Podman([]string{"pod", "ps", "-q", "--no-trunc", "--latest"})
result.WaitWithDefaultTimeout()
@@ -106,11 +94,10 @@ var _ = Describe("Podman ps", func() {
Expect(result.OutputToString()).To(Not(ContainSubstring(podid1)))
})
It("podman pod ps id filter flag", func() {
- session := podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
+ _, ec, podid := podmanTest.CreatePod("")
+ Expect(ec).To(Equal(0))
- result := podmanTest.Podman([]string{"pod", "ps", "--filter", fmt.Sprintf("id=%s", session.OutputToString())})
+ result := podmanTest.Podman([]string{"pod", "ps", "--filter", fmt.Sprintf("id=%s", podid)})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))
})
@@ -123,19 +110,16 @@ var _ = Describe("Podman ps", func() {
})
It("podman pod ps --sort by name", func() {
- session := podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
+ _, ec, _ := podmanTest.CreatePod("")
+ Expect(ec).To(Equal(0))
- session = podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
+ _, ec2, _ := podmanTest.CreatePod("")
+ Expect(ec2).To(Equal(0))
- session = podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
+ _, ec3, _ := podmanTest.CreatePod("")
+ Expect(ec3).To(Equal(0))
- session = podmanTest.Podman([]string{"pod", "ps", "--sort=name", "--format", "{{.Name}}"})
+ session := podmanTest.Podman([]string{"pod", "ps", "--sort=name", "--format", "{{.Name}}"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -146,16 +130,14 @@ var _ = Describe("Podman ps", func() {
})
It("podman pod ps --ctr-names", func() {
- session := podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
- podid := session.OutputToString()
+ _, ec, podid := podmanTest.CreatePod("")
+ Expect(ec).To(Equal(0))
- session = podmanTest.RunTopContainerInPod("test1", podid)
+ session := podmanTest.RunTopContainerInPod("test1", podid)
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- _, ec, _ := podmanTest.RunLsContainerInPod("test2", podid)
+ _, ec, _ = podmanTest.RunLsContainerInPod("test2", podid)
Expect(ec).To(Equal(0))
session = podmanTest.Podman([]string{"pod", "ps", "--format={{.ContainerInfo}}", "--ctr-names"})
@@ -166,22 +148,18 @@ var _ = Describe("Podman ps", func() {
})
It("podman pod ps filter ctr attributes", func() {
- session := podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
- podid1 := session.OutputToString()
+ _, ec, podid1 := podmanTest.CreatePod("")
+ Expect(ec).To(Equal(0))
- session = podmanTest.RunTopContainerInPod("test1", podid1)
+ session := podmanTest.RunTopContainerInPod("test1", podid1)
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
- podid2 := session.OutputToString()
+ _, ec2, podid2 := podmanTest.CreatePod("")
+ Expect(ec2).To(Equal(0))
- _, ec, cid := podmanTest.RunLsContainerInPod("test2", podid2)
- Expect(ec).To(Equal(0))
+ _, ec3, cid := podmanTest.RunLsContainerInPod("test2", podid2)
+ Expect(ec3).To(Equal(0))
session = podmanTest.Podman([]string{"pod", "ps", "-q", "--no-trunc", "--filter", "ctr-names=test1"})
session.WaitWithDefaultTimeout()
@@ -195,10 +173,8 @@ var _ = Describe("Podman ps", func() {
Expect(session.OutputToString()).To(ContainSubstring(podid2))
Expect(session.OutputToString()).To(Not(ContainSubstring(podid1)))
- session = podmanTest.Podman([]string{"pod", "create"})
- session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
- podid3 := session.OutputToString()
+ _, ec3, podid3 := podmanTest.CreatePod("")
+ Expect(ec3).To(Equal(0))
session = podmanTest.Podman([]string{"pod", "ps", "-q", "--no-trunc", "--filter", "ctr-number=1"})
session.WaitWithDefaultTimeout()