diff options
author | Jhon Honce <jhonce@redhat.com> | 2020-10-08 13:15:09 -0700 |
---|---|---|
committer | Jhon Honce <jhonce@redhat.com> | 2020-10-08 14:55:58 -0700 |
commit | e9b667bb5f9c72fd9903bfa5efd081ad24a2482b (patch) | |
tree | dc4712e090d1b7a3429a251ad155e01de388da42 /test/e2e | |
parent | 0afbe2d15203447370b495c2ba2c960059cf7df4 (diff) | |
download | podman-e9b667bb5f9c72fd9903bfa5efd081ad24a2482b.tar.gz podman-e9b667bb5f9c72fd9903bfa5efd081ad24a2482b.tar.bz2 podman-e9b667bb5f9c72fd9903bfa5efd081ad24a2482b.zip |
Port V1 --format table to V2 podman
* volume ls
* container ps
* updated broken tests when skip removed
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/ps_test.go | 12 | ||||
-rw-r--r-- | test/e2e/volume_ls_test.go | 7 |
2 files changed, 10 insertions, 9 deletions
diff --git a/test/e2e/ps_test.go b/test/e2e/ps_test.go index 0f2ce2d46..48ef566ce 100644 --- a/test/e2e/ps_test.go +++ b/test/e2e/ps_test.go @@ -11,6 +11,7 @@ import ( "github.com/docker/go-units" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + . "github.com/onsi/gomega/gexec" ) var _ = Describe("Podman ps", func() { @@ -218,17 +219,16 @@ var _ = Describe("Podman ps", func() { }) It("podman ps namespace flag with go template format", func() { - Skip("FIXME: table still not supported in podman ps command") _, ec, _ := podmanTest.RunLsContainer("test1") Expect(ec).To(Equal(0)) result := podmanTest.Podman([]string{"ps", "-a", "--format", "table {{.ID}} {{.Image}} {{.ImageID}} {{.Labels}}"}) result.WaitWithDefaultTimeout() - Expect(strings.Contains(result.OutputToStringArray()[0], "table")).To(BeFalse()) - Expect(strings.Contains(result.OutputToStringArray()[0], "ID")).To(BeTrue()) - Expect(strings.Contains(result.OutputToStringArray()[0], "ImageID")).To(BeTrue()) - Expect(strings.Contains(result.OutputToStringArray()[1], "alpine:latest")).To(BeTrue()) - Expect(result.ExitCode()).To(Equal(0)) + + Expect(result.OutputToStringArray()[0]).ToNot(ContainSubstring("table")) + Expect(result.OutputToStringArray()[0]).ToNot(ContainSubstring("ImageID")) + Expect(result.OutputToStringArray()[0]).To(ContainSubstring("alpine:latest")) + Expect(result).Should(Exit(0)) }) It("podman ps ancestor filter flag", func() { diff --git a/test/e2e/volume_ls_test.go b/test/e2e/volume_ls_test.go index 4a2c2d324..1cb6440aa 100644 --- a/test/e2e/volume_ls_test.go +++ b/test/e2e/volume_ls_test.go @@ -7,6 +7,7 @@ import ( . "github.com/containers/podman/v2/test/utils" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + . "github.com/onsi/gomega/gexec" ) var _ = Describe("Podman volume ls", func() { @@ -56,15 +57,15 @@ var _ = Describe("Podman volume ls", func() { }) It("podman ls volume with Go template", func() { - Skip("FIXME: table still not supported in podman volume command") session := podmanTest.Podman([]string{"volume", "create", "myvol"}) session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(Equal(0)) session = podmanTest.Podman([]string{"volume", "ls", "--format", "table {{.Name}} {{.Driver}} {{.Scope}}"}) session.WaitWithDefaultTimeout() - Expect(session.ExitCode()).To(Equal(0)) - Expect(len(session.OutputToStringArray())).To(Equal(2)) + + Expect(session).Should(Exit(0)) + Expect(len(session.OutputToStringArray())).To(Equal(1), session.OutputToString()) }) It("podman ls volume with --filter flag", func() { |