diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-10-30 17:00:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-30 17:00:22 +0100 |
commit | e632f3f2588d00184a50a7328d54a31ccf973708 (patch) | |
tree | e7fb78c6ae6c81a77aac78015e7a0421de6d552c /test | |
parent | 6b5a94cf2831df0633cc03a28f432177c0ee1d7b (diff) | |
parent | d60a0ddcc1784b2dd807cc8e4d4f3deb0c074171 (diff) | |
download | podman-e632f3f2588d00184a50a7328d54a31ccf973708.tar.gz podman-e632f3f2588d00184a50a7328d54a31ccf973708.tar.bz2 podman-e632f3f2588d00184a50a7328d54a31ccf973708.zip |
Merge pull request #8187 from jwhonce/wip/table
Restore --format table header support
Diffstat (limited to 'test')
-rw-r--r-- | test/utils/utils.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/utils/utils.go b/test/utils/utils.go index cb76d4a54..dd836f258 100644 --- a/test/utils/utils.go +++ b/test/utils/utils.go @@ -14,7 +14,7 @@ import ( "github.com/containers/storage/pkg/parsers/kernel" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "github.com/onsi/gomega/gexec" + . "github.com/onsi/gomega/gexec" ) var ( @@ -48,7 +48,7 @@ type PodmanTest struct { // PodmanSession wraps the gexec.session so we can extend it type PodmanSession struct { - *gexec.Session + *Session } // HostOS is a simple struct for the test os @@ -96,7 +96,7 @@ func (p *PodmanTest) PodmanAsUserBase(args []string, uid, gid uint32, cwd string command.ExtraFiles = extraFiles - session, err := gexec.Start(command, GinkgoWriter, GinkgoWriter) + session, err := Start(command, GinkgoWriter, GinkgoWriter) if err != nil { Fail(fmt.Sprintf("unable to run podman command: %s\n%v", strings.Join(podmanOptions, " "), err)) } @@ -125,7 +125,7 @@ func (p *PodmanTest) NumberOfContainersRunning() int { var containers []string ps := p.PodmanBase([]string{"ps", "-q"}, false, true) ps.WaitWithDefaultTimeout() - Expect(ps.ExitCode()).To(Equal(0)) + Expect(ps).Should(Exit(0)) for _, i := range ps.OutputToStringArray() { if i != "" { containers = append(containers, i) @@ -318,7 +318,7 @@ func (s *PodmanSession) IsJSONOutputValid() bool { // WaitWithDefaultTimeout waits for process finished with defaultWaitTimeout func (s *PodmanSession) WaitWithDefaultTimeout() { - Eventually(s, defaultWaitTimeout).Should(gexec.Exit()) + Eventually(s, defaultWaitTimeout).Should(Exit()) os.Stdout.Sync() os.Stderr.Sync() fmt.Println("output:", s.OutputToString()) @@ -332,7 +332,7 @@ func CreateTempDirInTempDir() (string, error) { // SystemExec is used to exec a system command to check its exit code or output func SystemExec(command string, args []string) *PodmanSession { c := exec.Command(command, args...) - session, err := gexec.Start(c, GinkgoWriter, GinkgoWriter) + session, err := Start(c, GinkgoWriter, GinkgoWriter) if err != nil { Fail(fmt.Sprintf("unable to run command: %s %s", command, strings.Join(args, " "))) } @@ -343,7 +343,7 @@ func SystemExec(command string, args []string) *PodmanSession { // StartSystemExec is used to start exec a system command func StartSystemExec(command string, args []string) *PodmanSession { c := exec.Command(command, args...) - session, err := gexec.Start(c, GinkgoWriter, GinkgoWriter) + session, err := Start(c, GinkgoWriter, GinkgoWriter) if err != nil { Fail(fmt.Sprintf("unable to run command: %s %s", command, strings.Join(args, " "))) } |