summaryrefslogtreecommitdiff
path: root/test/e2e/pod_top_test.go
diff options
context:
space:
mode:
authorhaircommander <pehunt@redhat.com>2018-08-20 17:56:35 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-23 18:16:28 +0000
commit0e6266858a913ac36de0726ede10d5d03af533e3 (patch)
tree152c7b8b029d5eb80c6caf466c9d0ab1b0ef3913 /test/e2e/pod_top_test.go
parent2a7449362f2884d9ae6a783c0ce38979d882e2cf (diff)
downloadpodman-0e6266858a913ac36de0726ede10d5d03af533e3.tar.gz
podman-0e6266858a913ac36de0726ede10d5d03af533e3.tar.bz2
podman-0e6266858a913ac36de0726ede10d5d03af533e3.zip
Fixing network ns segfault
As well as small style corrections, update pod_top_test to use CreatePod, and move handling of adding a container to the pod's namespace from container_internal_linux to libpod/option. Signed-off-by: haircommander <pehunt@redhat.com> Closes: #1187 Approved by: mheon
Diffstat (limited to 'test/e2e/pod_top_test.go')
-rw-r--r--test/e2e/pod_top_test.go46
1 files changed, 17 insertions, 29 deletions
diff --git a/test/e2e/pod_top_test.go b/test/e2e/pod_top_test.go
index 2b4aa540f..0ecc8e6e8 100644
--- a/test/e2e/pod_top_test.go
+++ b/test/e2e/pod_top_test.go
@@ -44,10 +44,8 @@ var _ = Describe("Podman top", func() {
})
It("podman pod top on non-running pod", 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))
result := podmanTest.Podman([]string{"top", podid})
result.WaitWithDefaultTimeout()
@@ -55,12 +53,10 @@ var _ = Describe("Podman top", func() {
})
It("podman pod top on pod", 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.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top", "-d", "2"})
+ session := podmanTest.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top", "-d", "2"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -71,12 +67,10 @@ var _ = Describe("Podman top", func() {
})
It("podman pod top with options", 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.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top", "-d", "2"})
+ session := podmanTest.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top", "-d", "2"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -87,12 +81,10 @@ var _ = Describe("Podman top", func() {
})
It("podman pod top on pod invalid options", 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.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top", "-d", "2"})
+ session := podmanTest.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top", "-d", "2"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
@@ -102,12 +94,10 @@ var _ = Describe("Podman top", func() {
})
It("podman pod top on pod with containers in same pid namespace", 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.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top", "-d", "2"})
+ session := podmanTest.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top", "-d", "2"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
cid := session.OutputToString()
@@ -123,12 +113,10 @@ var _ = Describe("Podman top", func() {
})
It("podman pod top on pod with containers in different namespace", 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.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top", "-d", "2"})
+ session := podmanTest.Podman([]string{"run", "-d", "--pod", podid, ALPINE, "top", "-d", "2"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))