summaryrefslogtreecommitdiff
path: root/test/e2e/run_seccomp_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e/run_seccomp_test.go')
-rw-r--r--test/e2e/run_seccomp_test.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/e2e/run_seccomp_test.go b/test/e2e/run_seccomp_test.go
index ed1cdeecd..3a6adca0e 100644
--- a/test/e2e/run_seccomp_test.go
+++ b/test/e2e/run_seccomp_test.go
@@ -6,6 +6,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 run", func() {
@@ -35,20 +36,20 @@ var _ = Describe("Podman run", func() {
It("podman run --seccomp-policy default", func() {
session := podmanTest.Podman([]string{"run", "--seccomp-policy", "default", alpineSeccomp, "ls"})
session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
+ Expect(session).Should(Exit(0))
})
It("podman run --seccomp-policy ''", func() {
// Empty string is interpreted as "default".
session := podmanTest.Podman([]string{"run", "--seccomp-policy", "", alpineSeccomp, "ls"})
session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(0))
+ Expect(session).Should(Exit(0))
})
It("podman run --seccomp-policy invalid", func() {
session := podmanTest.Podman([]string{"run", "--seccomp-policy", "invalid", alpineSeccomp, "ls"})
session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).ToNot(Equal(0))
+ Expect(session).To(ExitWithError())
})
It("podman run --seccomp-policy image (block all syscalls)", func() {
@@ -57,12 +58,12 @@ var _ = Describe("Podman run", func() {
// TODO: we're getting a "cannot start a container that has
// stopped" error which seems surprising. Investigate
// why that is so.
- Expect(session.ExitCode()).ToNot(Equal(0))
+ Expect(session).To(ExitWithError())
})
It("podman run --seccomp-policy image (bogus profile)", func() {
session := podmanTest.Podman([]string{"run", "--seccomp-policy", "image", alpineBogusSeccomp, "ls"})
session.WaitWithDefaultTimeout()
- Expect(session.ExitCode()).To(Equal(125))
+ Expect(session).Should(Exit(125))
})
})