From 756dda298c76b54a4401b7497bbff297dcf4014f Mon Sep 17 00:00:00 2001 From: Markus Thömmes Date: Thu, 4 Nov 2021 16:12:34 +0100 Subject: Keep error semantics intact MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Markus Thömmes --- test/system/001-basic.bats | 2 +- test/system/015-help.bats | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'test') diff --git a/test/system/001-basic.bats b/test/system/001-basic.bats index 2a6f4bea0..ccc05bb15 100644 --- a/test/system/001-basic.bats +++ b/test/system/001-basic.bats @@ -100,7 +100,7 @@ function setup() { skip "only applicable on a local run since this requires no endpoint" fi - run_podman --remote + run_podman 125 --remote is "$output" ".*Usage:" "podman --remote show usage message without running endpoint" } diff --git a/test/system/015-help.bats b/test/system/015-help.bats index 51660ba12..b2c6e2575 100644 --- a/test/system/015-help.bats +++ b/test/system/015-help.bats @@ -143,16 +143,13 @@ function check_help() { count=$(expr $count + 1) done - # Any command that takes subcommands, prints its help if called + # Any command that takes subcommands, prints its help and errors if called # without one. dprint "podman $@" - - # Store the output of the actual --help command - run_podman "$@" --help - local full_help="$output" - - run_podman "$@" - is "$output" "$full_help" "'podman $*' without any subcommand - expected help message" + run_podman '?' "$@" + is "$status" 125 "'podman $*' without any subcommand - exit status" + is "$output" ".*Usage:.*Error: missing command '.*$@ COMMAND'" \ + "'podman $*' without any subcommand - expected error message" # Assume that 'NoSuchCommand' is not a command dprint "podman $@ NoSuchCommand" -- cgit v1.2.3-54-g00ecf