summaryrefslogtreecommitdiff
path: root/test/e2e/create_staticip_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/create_staticip_test.go')
-rw-r--r--test/e2e/create_staticip_test.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/test/e2e/create_staticip_test.go b/test/e2e/create_staticip_test.go
index 2cf552274..205855fd6 100644
--- a/test/e2e/create_staticip_test.go
+++ b/test/e2e/create_staticip_test.go
@@ -8,6 +8,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 create with --ip flag", func() {
@@ -52,7 +53,7 @@ var _ = Describe("Podman create with --ip flag", func() {
SkipIfRootless("--ip not supported without network in rootless mode")
result := podmanTest.Podman([]string{"create", "--name", "test", "--ip", "203.0.113.124", ALPINE, "ls"})
result.WaitWithDefaultTimeout()
- Expect(result.ExitCode()).To(Equal(0))
+ Expect(result).Should(Exit(0))
result = podmanTest.Podman([]string{"start", "test"})
result.WaitWithDefaultTimeout()
@@ -67,17 +68,17 @@ var _ = Describe("Podman create with --ip flag", func() {
result.WaitWithDefaultTimeout()
// Rootless static ip assignment without network should error
if rootless.IsRootless() {
- Expect(result.ExitCode()).To(Equal(125))
+ Expect(result).Should(Exit(125))
} else {
- Expect(result.ExitCode()).To(Equal(0))
+ Expect(result).Should(Exit(0))
result = podmanTest.Podman([]string{"start", "test"})
result.WaitWithDefaultTimeout()
- Expect(result.ExitCode()).To(Equal(0))
+ Expect(result).Should(Exit(0))
result = podmanTest.Podman([]string{"logs", "test"})
result.WaitWithDefaultTimeout()
- Expect(result.ExitCode()).To(Equal(0))
+ Expect(result).Should(Exit(0))
Expect(result.OutputToString()).To(ContainSubstring(ip + "/16"))
}
})
@@ -87,19 +88,19 @@ var _ = Describe("Podman create with --ip flag", func() {
ip := GetRandomIPAddress()
result := podmanTest.Podman([]string{"create", "--log-driver", "k8s-file", "--name", "test1", "--ip", ip, ALPINE, "sleep", "999"})
result.WaitWithDefaultTimeout()
- Expect(result.ExitCode()).To(Equal(0))
+ Expect(result).Should(Exit(0))
result = podmanTest.Podman([]string{"create", "--log-driver", "k8s-file", "--name", "test2", "--ip", ip, ALPINE, "ip", "addr"})
result.WaitWithDefaultTimeout()
- Expect(result.ExitCode()).To(Equal(0))
+ Expect(result).Should(Exit(0))
result = podmanTest.Podman([]string{"start", "test1"})
result.WaitWithDefaultTimeout()
- Expect(result.ExitCode()).To(Equal(0))
+ Expect(result).Should(Exit(0))
// race prevention: wait until IP address is assigned
for i := 0; i < 5; i++ {
result = podmanTest.Podman([]string{"inspect", "--format", "{{.NetworkSettings.IPAddress}}", "test1"})
result.WaitWithDefaultTimeout()
- Expect(result.ExitCode()).To(Equal(0))
+ Expect(result).Should(Exit(0))
if result.OutputToString() != "" {
break
}