mirror of
https://github.com/containers/podman.git
synced 2025-10-17 19:24:04 +08:00
ExitWithError() - more run_xxx tests
Followup to #22270: wherever possible/practical, extend command error checks to include explicit exit status codes and error strings. This commit handles a subset of test/e2e/run_xxx_test.go Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
@ -98,7 +98,7 @@ profile aa-test-profile flags=(attach_disconnected,mediate_deleted) {
|
||||
skipIfAppArmorDisabled()
|
||||
session := podmanTest.Podman([]string{"run", "--security-opt", "apparmor=invalid", ALPINE, "ls"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).To(ExitWithError())
|
||||
Expect(session).To(ExitWithError(126, `AppArmor profile "invalid" specified but not loaded`))
|
||||
})
|
||||
|
||||
It("podman run apparmor unconfined", func() {
|
||||
@ -118,7 +118,7 @@ profile aa-test-profile flags=(attach_disconnected,mediate_deleted) {
|
||||
// Should fail if user specifies apparmor on disabled system
|
||||
session := podmanTest.Podman([]string{"create", "--security-opt", fmt.Sprintf("apparmor=%s", apparmor.Profile), ALPINE, "ls"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).To(ExitWithError())
|
||||
Expect(session).To(ExitWithError(125, fmt.Sprintf(`apparmor profile "%s" specified, but Apparmor is not enabled on this system`, apparmor.Profile)))
|
||||
})
|
||||
|
||||
It("podman run apparmor disabled no default", func() {
|
||||
|
Reference in New Issue
Block a user