summaryrefslogtreecommitdiff
path: root/test/e2e/common_test.go
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2020-04-22 17:33:13 -0700
committerJhon Honce <jhonce@redhat.com>2020-04-29 08:24:56 -0700
commita9cc13448ee3185bb63f4c3eef94e755e79b8571 (patch)
treee91e17ca9c46540aedbec46e7268ba5f65b24d0c /test/e2e/common_test.go
parent27aa3a7837fa1c5379ff7ca1a9dcd6416b2ac685 (diff)
downloadpodman-a9cc13448ee3185bb63f4c3eef94e755e79b8571.tar.gz
podman-a9cc13448ee3185bb63f4c3eef94e755e79b8571.tar.bz2
podman-a9cc13448ee3185bb63f4c3eef94e755e79b8571.zip
V2 Restore images list tests
* Fix history --quiet formatting * Fix image inspect --format=json * Fix image list --sort Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'test/e2e/common_test.go')
-rw-r--r--test/e2e/common_test.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go
index 160af1bd5..68f733b41 100644
--- a/test/e2e/common_test.go
+++ b/test/e2e/common_test.go
@@ -1,7 +1,6 @@
package integration
import (
- "encoding/json"
"fmt"
"io/ioutil"
"math/rand"
@@ -21,9 +20,10 @@ import (
"github.com/containers/storage"
"github.com/containers/storage/pkg/reexec"
"github.com/containers/storage/pkg/stringid"
+ jsoniter "github.com/json-iterator/go"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
- "github.com/onsi/gomega/gexec"
+ . "github.com/onsi/gomega/gexec"
"github.com/pkg/errors"
)
@@ -314,7 +314,7 @@ func (p *PodmanTestIntegration) createArtifact(image string) {
// image and returns json
func (s *PodmanSessionIntegration) InspectImageJSON() []inspect.ImageData {
var i []inspect.ImageData
- err := json.Unmarshal(s.Out.Contents(), &i)
+ err := jsoniter.Unmarshal(s.Out.Contents(), &i)
Expect(err).To(BeNil())
return i
}
@@ -324,7 +324,7 @@ func (p *PodmanTestIntegration) InspectContainer(name string) []define.InspectCo
cmd := []string{"inspect", name}
session := p.Podman(cmd)
session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
+ Expect(session).Should(Exit(0))
return session.InspectContainerToJSON()
}
@@ -419,7 +419,7 @@ func (p *PodmanTestIntegration) PodmanPID(args []string) (*PodmanSessionIntegrat
podmanOptions := p.MakeOptions(args, false, false)
fmt.Printf("Running: %s %s\n", p.PodmanBinary, strings.Join(podmanOptions, " "))
command := exec.Command(p.PodmanBinary, podmanOptions...)
- 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", strings.Join(podmanOptions, " ")))
}
@@ -494,7 +494,7 @@ func (p *PodmanTestIntegration) PullImage(image string) error {
// container and returns json
func (s *PodmanSessionIntegration) InspectContainerToJSON() []define.InspectContainerData {
var i []define.InspectContainerData
- err := json.Unmarshal(s.Out.Contents(), &i)
+ err := jsoniter.Unmarshal(s.Out.Contents(), &i)
Expect(err).To(BeNil())
return i
}
@@ -502,7 +502,7 @@ func (s *PodmanSessionIntegration) InspectContainerToJSON() []define.InspectCont
// InspectPodToJSON takes the sessions output from a pod inspect and returns json
func (s *PodmanSessionIntegration) InspectPodToJSON() define.InspectPodData {
var i define.InspectPodData
- err := json.Unmarshal(s.Out.Contents(), &i)
+ err := jsoniter.Unmarshal(s.Out.Contents(), &i)
Expect(err).To(BeNil())
return i
}