mirror of
https://github.com/containers/podman.git
synced 2025-11-29 01:28:22 +08:00
ExitWithError() - enforce required exit status & stderr
Final followup to #22270. That PR added a temporary convention allowing a new form of ExitWithError(), one with an exit code and stderr substring. In order to allow bite-size progress, the old no-args form was still allowed. This PR removes support for no-args ExitWithError(). This PR also adds one piece of new functionality: passing "" (empty string) as the stderr arg means "expect exit code but fail if there's anything at all in stderr". Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
@@ -39,7 +39,7 @@ var _ = Describe("Podman start", func() {
|
||||
Expect(session).Should(ExitWithError(125, "not found in $PATH"))
|
||||
session = podmanTest.Podman([]string{"container", "exists", "test"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).To(ExitWithError(1))
|
||||
Expect(session).To(ExitWithError(1, ""))
|
||||
})
|
||||
|
||||
It("podman start --rm --attach removed on failure", func() {
|
||||
@@ -52,7 +52,7 @@ var _ = Describe("Podman start", func() {
|
||||
Expect(session).Should(ExitWithError(125, "not found in $PATH"))
|
||||
session = podmanTest.Podman([]string{"container", "exists", cid})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).To(ExitWithError(1))
|
||||
Expect(session).To(ExitWithError(1, ""))
|
||||
})
|
||||
|
||||
It("podman container start single container by id", func() {
|
||||
@@ -97,7 +97,7 @@ var _ = Describe("Podman start", func() {
|
||||
session = podmanTest.Podman([]string{"start", "--attach", cid})
|
||||
session.WaitWithDefaultTimeout()
|
||||
// It should forward the signal
|
||||
Expect(session).Should(ExitWithError(1))
|
||||
Expect(session).Should(ExitWithError(1, ""))
|
||||
})
|
||||
|
||||
It("podman start multiple containers", func() {
|
||||
|
||||
Reference in New Issue
Block a user