summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-05-08 17:57:10 +0200
committerGitHub <noreply@github.com>2020-05-08 17:57:10 +0200
commit13db0f2b61b17e6f959fff832b40270352cd54da (patch)
treeab1c4ca5ea7926e0731136bb4e358c6d3407f8da /test
parent2547fe53127057ce8f3ba065b4263fea32be7f0d (diff)
parent20407a2f1fadb1488caac1560dfdd56facff4153 (diff)
downloadpodman-13db0f2b61b17e6f959fff832b40270352cd54da.tar.gz
podman-13db0f2b61b17e6f959fff832b40270352cd54da.tar.bz2
podman-13db0f2b61b17e6f959fff832b40270352cd54da.zip
Merge pull request #6118 from baude/v2bindingsenforce
set binding tests to required
Diffstat (limited to 'test')
-rw-r--r--test/e2e/stats_test.go20
1 files changed, 16 insertions, 4 deletions
diff --git a/test/e2e/stats_test.go b/test/e2e/stats_test.go
index 762417a17..d3af44891 100644
--- a/test/e2e/stats_test.go
+++ b/test/e2e/stats_test.go
@@ -5,6 +5,7 @@ package integration
import (
"fmt"
"os"
+ "time"
"github.com/containers/libpod/pkg/cgroups"
. "github.com/containers/libpod/test/utils"
@@ -87,13 +88,24 @@ var _ = Describe("Podman stats", func() {
})
It("podman stats with json output", func() {
+ var found bool
session := podmanTest.RunTopContainer("")
session.WaitWithDefaultTimeout()
Expect(session.ExitCode()).To(Equal(0))
- session = podmanTest.Podman([]string{"stats", "--all", "--no-stream", "--format", "json"})
- session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
- Expect(session.IsJSONOutputValid()).To(BeTrue())
+ for i := 0; i < 5; i++ {
+ ps := podmanTest.Podman([]string{"ps", "-q"})
+ ps.WaitWithDefaultTimeout()
+ if len(ps.OutputToStringArray()) == 1 {
+ found = true
+ break
+ }
+ time.Sleep(time.Second)
+ }
+ Expect(found).To(BeTrue())
+ stats := podmanTest.Podman([]string{"stats", "--all", "--no-stream", "--format", "json"})
+ stats.WaitWithDefaultTimeout()
+ Expect(stats.ExitCode()).To(Equal(0))
+ Expect(stats.IsJSONOutputValid()).To(BeTrue())
})
It("podman stats on a container with no net ns", func() {