summaryrefslogtreecommitdiff
path: root/test/e2e/volume_inspect_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/volume_inspect_test.go')
-rw-r--r--test/e2e/volume_inspect_test.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/test/e2e/volume_inspect_test.go b/test/e2e/volume_inspect_test.go
index 05aaf1025..db95ba675 100644
--- a/test/e2e/volume_inspect_test.go
+++ b/test/e2e/volume_inspect_test.go
@@ -7,6 +7,7 @@ import (
. "github.com/containers/podman/v3/test/utils"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
+ . "github.com/onsi/gomega/gexec"
)
var _ = Describe("Podman volume inspect", func() {
@@ -37,11 +38,11 @@ var _ = Describe("Podman volume inspect", func() {
session := podmanTest.Podman([]string{"volume", "create", "myvol"})
session.WaitWithDefaultTimeout()
volName := session.OutputToString()
- Expect(session.ExitCode()).To(Equal(0))
+ Expect(session).Should(Exit(0))
session = podmanTest.Podman([]string{"volume", "inspect", volName})
session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
+ Expect(session).Should(Exit(0))
Expect(session.IsJSONOutputValid()).To(BeTrue())
})
@@ -49,11 +50,11 @@ var _ = Describe("Podman volume inspect", func() {
session := podmanTest.Podman([]string{"volume", "create", "myvol"})
session.WaitWithDefaultTimeout()
volName := session.OutputToString()
- Expect(session.ExitCode()).To(Equal(0))
+ Expect(session).Should(Exit(0))
session = podmanTest.Podman([]string{"volume", "inspect", "--format", "{{.Name}}", volName})
session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
+ Expect(session).Should(Exit(0))
Expect(session.OutputToString()).To(Equal(volName))
})
@@ -61,16 +62,16 @@ var _ = Describe("Podman volume inspect", func() {
session := podmanTest.Podman([]string{"volume", "create", "myvol1"})
session.WaitWithDefaultTimeout()
volName1 := session.OutputToString()
- Expect(session.ExitCode()).To(Equal(0))
+ Expect(session).Should(Exit(0))
session = podmanTest.Podman([]string{"volume", "create", "myvol2"})
session.WaitWithDefaultTimeout()
volName2 := session.OutputToString()
- Expect(session.ExitCode()).To(Equal(0))
+ Expect(session).Should(Exit(0))
session = podmanTest.Podman([]string{"volume", "inspect", "--format", "{{.Name}}", "--all"})
session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
+ Expect(session).Should(Exit(0))
Expect(len(session.OutputToStringArray())).To(Equal(2))
Expect(session.OutputToStringArray()[0]).To(Equal(volName1))
Expect(session.OutputToStringArray()[1]).To(Equal(volName2))
@@ -80,11 +81,11 @@ var _ = Describe("Podman volume inspect", func() {
volName := "testvol"
session := podmanTest.Podman([]string{"volume", "create", "--opt", "type=tmpfs", volName})
session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
+ Expect(session).Should(Exit(0))
inspect := podmanTest.Podman([]string{"volume", "inspect", volName})
inspect.WaitWithDefaultTimeout()
- Expect(inspect.ExitCode()).To(Equal(0))
+ Expect(inspect).Should(Exit(0))
Expect(strings.Contains(inspect.OutputToString(), "tmpfs")).To(BeTrue())
})
})