mirror of
https://github.com/containers/podman.git
synced 2025-11-28 17:18:58 +08:00
ExitWithError() - yet more low-hanging fruit
Followup to [1]#22270: wherever possible/practical, extend command error checks to include explicit exit status codes and error strings. Just trying to shrink down #22346 to a manageable, reviewable size. Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package integration
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
. "github.com/containers/podman/v5/test/utils"
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
. "github.com/onsi/gomega"
|
||||
@@ -11,6 +13,10 @@ var _ = Describe("Podman negative command-line", func() {
|
||||
It("podman snuffleupagus exits non-zero", func() {
|
||||
session := podmanTest.Podman([]string{"snuffleupagus"})
|
||||
session.WaitWithDefaultTimeout()
|
||||
Expect(session).To(ExitWithError())
|
||||
cmdName := "podman"
|
||||
if IsRemote() {
|
||||
cmdName += "-remote"
|
||||
}
|
||||
Expect(session).To(ExitWithError(125, fmt.Sprintf("unrecognized command `%s snuffleupagus`", cmdName)))
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user