diff options
author | Matthew Heon <mheon@redhat.com> | 2019-04-23 13:15:24 -0400 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2019-04-24 12:51:41 -0400 |
commit | c3c2ba079d6a466236d8f1bbc9c6b0f6173dd408 (patch) | |
tree | b91957cf4ba0fb281a01cf0bcaed5dcb8119c8c8 | |
parent | 597b2ebfeaeb1c2aec6790d5e3351a8889e2dc46 (diff) | |
download | podman-c3c2ba079d6a466236d8f1bbc9c6b0f6173dd408.tar.gz podman-c3c2ba079d6a466236d8f1bbc9c6b0f6173dd408.tar.bz2 podman-c3c2ba079d6a466236d8f1bbc9c6b0f6173dd408.zip |
Trim whitespace from ps -q before comparing
Signed-off-by: Matthew Heon <mheon@redhat.com>
-rw-r--r-- | test/e2e/stop_test.go | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/test/e2e/stop_test.go b/test/e2e/stop_test.go index 259410736..8f7bb2308 100644 --- a/test/e2e/stop_test.go +++ b/test/e2e/stop_test.go @@ -4,6 +4,7 @@ package integration import ( "os" + "strings" . "github.com/containers/libpod/test/utils" . "github.com/onsi/ginkgo" @@ -52,7 +53,7 @@ var _ = Describe("Podman stop", func() { finalCtrs := podmanTest.Podman([]string("ps", "-q")) finalCtrs.WaitWithDefaultTimeout() Expect(finalCtrs.ExitCode()).To(Equal(0)) - Expect(finalCtrs.OutputToString()).To(Equal("")) + Expect(strings.TrimSpace(finalCtrs.OutputToString())).To(Equal("")) }) It("podman stop container by name", func() { @@ -66,7 +67,7 @@ var _ = Describe("Podman stop", func() { finalCtrs := podmanTest.Podman([]string("ps", "-q")) finalCtrs.WaitWithDefaultTimeout() Expect(finalCtrs.ExitCode()).To(Equal(0)) - Expect(finalCtrs.OutputToString()).To(Equal("")) + Expect(strings.TrimSpace(finalCtrs.OutputToString())).To(Equal("")) }) It("podman container stop by name", func() { @@ -80,7 +81,7 @@ var _ = Describe("Podman stop", func() { finalCtrs := podmanTest.Podman([]string("ps", "-q")) finalCtrs.WaitWithDefaultTimeout() Expect(finalCtrs.ExitCode()).To(Equal(0)) - Expect(finalCtrs.OutputToString()).To(Equal("")) + Expect(strings.TrimSpace(finalCtrs.OutputToString())).To(Equal("")) }) It("podman stop stopped container", func() { @@ -99,7 +100,7 @@ var _ = Describe("Podman stop", func() { finalCtrs := podmanTest.Podman([]string("ps", "-q")) finalCtrs.WaitWithDefaultTimeout() Expect(finalCtrs.ExitCode()).To(Equal(0)) - Expect(finalCtrs.OutputToString()).To(Equal("")) + Expect(strings.TrimSpace(finalCtrs.OutputToString())).To(Equal("")) }) It("podman stop all containers -t", func() { @@ -129,7 +130,7 @@ var _ = Describe("Podman stop", func() { finalCtrs := podmanTest.Podman([]string("ps", "-q")) finalCtrs.WaitWithDefaultTimeout() Expect(finalCtrs.ExitCode()).To(Equal(0)) - Expect(finalCtrs.OutputToString()).To(Equal("")) + Expect(strings.TrimSpace(finalCtrs.OutputToString())).To(Equal("")) }) It("podman stop container --time", func() { @@ -147,7 +148,7 @@ var _ = Describe("Podman stop", func() { finalCtrs := podmanTest.Podman([]string("ps", "-q")) finalCtrs.WaitWithDefaultTimeout() Expect(finalCtrs.ExitCode()).To(Equal(0)) - Expect(finalCtrs.OutputToString()).To(Equal("")) + Expect(strings.TrimSpace(finalCtrs.OutputToString())).To(Equal("")) }) It("podman stop container --timeout", func() { @@ -165,7 +166,7 @@ var _ = Describe("Podman stop", func() { finalCtrs := podmanTest.Podman([]string("ps", "-q")) finalCtrs.WaitWithDefaultTimeout() Expect(finalCtrs.ExitCode()).To(Equal(0)) - Expect(finalCtrs.OutputToString()).To(Equal("")) + Expect(strings.TrimSpace(finalCtrs.OutputToString())).To(Equal("")) }) It("podman stop latest containers", func() { @@ -178,7 +179,7 @@ var _ = Describe("Podman stop", func() { finalCtrs := podmanTest.Podman([]string("ps", "-q")) finalCtrs.WaitWithDefaultTimeout() Expect(finalCtrs.ExitCode()).To(Equal(0)) - Expect(finalCtrs.OutputToString()).To(Equal("")) + Expect(strings.TrimSpace(finalCtrs.OutputToString())).To(Equal("")) }) It("podman stop all containers with one stopped", func() { @@ -197,7 +198,7 @@ var _ = Describe("Podman stop", func() { finalCtrs := podmanTest.Podman([]string("ps", "-q")) finalCtrs.WaitWithDefaultTimeout() Expect(finalCtrs.ExitCode()).To(Equal(0)) - Expect(finalCtrs.OutputToString()).To(Equal("")) + Expect(strings.TrimSpace(finalCtrs.OutputToString())).To(Equal("")) }) It("podman stop all containers with one created", func() { @@ -213,7 +214,7 @@ var _ = Describe("Podman stop", func() { finalCtrs := podmanTest.Podman([]string("ps", "-q")) finalCtrs.WaitWithDefaultTimeout() Expect(finalCtrs.ExitCode()).To(Equal(0)) - Expect(finalCtrs.OutputToString()).To(Equal("")) + Expect(strings.TrimSpace(finalCtrs.OutputToString())).To(Equal("")) }) }) |