summaryrefslogtreecommitdiff
path: root/test/e2e/top_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/top_test.go')
-rw-r--r--test/e2e/top_test.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/e2e/top_test.go b/test/e2e/top_test.go
index d4438293b..410803353 100644
--- a/test/e2e/top_test.go
+++ b/test/e2e/top_test.go
@@ -59,14 +59,26 @@ var _ = Describe("Podman top", func() {
Expect(len(result.OutputToStringArray())).To(BeNumerically(">", 1))
})
- It("podman top on non-running container", func() {
+ It("podman top with options", func() {
session := podmanTest.Podman([]string{"run", "-d", ALPINE, "top", "-d", "2"})
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- result := podmanTest.Podman([]string{"top", session.OutputToString(), "-o", "fuser,f,comm,label"})
+ result := podmanTest.Podman([]string{"top", session.OutputToString(), "-o", "pid,fuser,f,comm,label"})
result.WaitWithDefaultTimeout()
Expect(result.ExitCode()).To(Equal(0))
Expect(len(result.OutputToStringArray())).To(BeNumerically(">", 1))
})
+
+ It("podman top on container invalid options", func() {
+ sleep := podmanTest.RunSleepContainer("")
+ sleep.WaitWithDefaultTimeout()
+ Expect(sleep.ExitCode()).To(Equal(0))
+ cid := sleep.OutputToString()
+
+ result := podmanTest.Podman([]string{"top", cid, "-o time"})
+ result.WaitWithDefaultTimeout()
+ Expect(result.ExitCode()).To(Equal(125))
+ })
+
})