diff options
Diffstat (limited to 'test/e2e/common_test.go')
-rw-r--r-- | test/e2e/common_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go index 781bbb6d2..ffa6f1329 100644 --- a/test/e2e/common_test.go +++ b/test/e2e/common_test.go @@ -1,6 +1,7 @@ package integration import ( + "bytes" "fmt" "io/ioutil" "math/rand" @@ -794,3 +795,12 @@ func (p *PodmanTestIntegration) removeCNINetwork(name string) { session.WaitWithDefaultTimeout() Expect(session.ExitCode()).To(BeNumerically("<=", 1)) } + +func (p *PodmanSessionIntegration) jq(jqCommand string) (string, error) { + var out bytes.Buffer + cmd := exec.Command("jq", jqCommand) + cmd.Stdin = strings.NewReader(p.OutputToString()) + cmd.Stdout = &out + err := cmd.Run() + return strings.TrimRight(out.String(), "\n"), err +} |