summaryrefslogtreecommitdiff
path: root/test/utils
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2021-09-17 15:05:51 -0700
committerJhon Honce <jhonce@redhat.com>2021-09-20 13:51:27 -0700
commit8453c8ce63b6ec3799f67198fd7119add67722d6 (patch)
tree37fc3f7acb526c8fbc76e75674825aa5949f0d58 /test/utils
parent7e8ce73c15036d50fc31f763c903c264392f1e04 (diff)
downloadpodman-8453c8ce63b6ec3799f67198fd7119add67722d6.tar.gz
podman-8453c8ce63b6ec3799f67198fd7119add67722d6.tar.bz2
podman-8453c8ce63b6ec3799f67198fd7119add67722d6.zip
Support --format tables in ps output
- Added tests to help ensure there is no future regressions - Added WaitWithTimeout(int) rather than calling WaitWithDefaultTimeout() multiple times - Exposed DefaultWaitTimeout to allow test to use a multiplier Fixes #2221 Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'test/utils')
-rw-r--r--test/utils/utils.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/utils/utils.go b/test/utils/utils.go
index 80af7fb7c..bfefc58ec 100644
--- a/test/utils/utils.go
+++ b/test/utils/utils.go
@@ -19,7 +19,7 @@ import (
)
var (
- defaultWaitTimeout = 90
+ DefaultWaitTimeout = 90
OSReleasePath = "/etc/os-release"
ProcessOneCgroupPath = "/proc/1/cgroup"
)
@@ -317,15 +317,20 @@ func (s *PodmanSession) IsJSONOutputValid() bool {
return true
}
-// WaitWithDefaultTimeout waits for process finished with defaultWaitTimeout
+// WaitWithDefaultTimeout waits for process finished with DefaultWaitTimeout
func (s *PodmanSession) WaitWithDefaultTimeout() {
- Eventually(s, defaultWaitTimeout).Should(Exit())
+ s.WaitWithTimeout(DefaultWaitTimeout)
+}
+
+// WaitWithTimeout waits for process finished with DefaultWaitTimeout
+func (s *PodmanSession) WaitWithTimeout(timeout int) {
+ Eventually(s, timeout).Should(Exit())
os.Stdout.Sync()
os.Stderr.Sync()
fmt.Println("output:", s.OutputToString())
}
-// CreateTempDirinTempDir create a temp dir with prefix podman_test
+// CreateTempDirInTempDir create a temp dir with prefix podman_test
func CreateTempDirInTempDir() (string, error) {
return ioutil.TempDir("", "podman_test")
}
@@ -337,7 +342,7 @@ func SystemExec(command string, args []string) *PodmanSession {
if err != nil {
Fail(fmt.Sprintf("unable to run command: %s %s", command, strings.Join(args, " ")))
}
- session.Wait(defaultWaitTimeout)
+ session.Wait(DefaultWaitTimeout)
return &PodmanSession{session}
}