Skip to content

Commit

Permalink
btrfs-progs: tests: add cases to combine --help with other options
Browse files Browse the repository at this point in the history
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
kdave committed Jan 28, 2025
1 parent ea8d082 commit 100f8e5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/cli-tests/001-btrfs/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,17 @@ run_check "$TOP/btrfs" -vvvv help
run_check "$TOP/btrfs" --log=quiet help
run_check "$TOP/btrfs" -q help
run_mustfail "invalid log level accepted" "$TOP/btrfs" --log=invalid help

# Combine help with other options
run_mustfail "unrecognized option accepted" "$TOP/btrfs" filesystem df -v
run_mustfail "unrecognized option accepted" "$TOP/btrfs" filesystem df -v /
run_mustfail "unrecognized option accepted" "$TOP/btrfs" filesystem df -v --help /
if ! run_check_stdout "$TOP/btrfs" filesystem df --help / | grep -q 'usage.*filesystem df'; then
_fail "standalone option --help"
fi
if ! run_check_stdout "$TOP/btrfs" filesystem df -H --help / | grep -q 'usage.*filesystem df'; then
_fail "option --help with valid option (1)"
fi
if ! run_check_stdout "$TOP/btrfs" filesystem df --help -H / | grep -q 'usage.*filesystem df'; then
_fail "option --help with valid option (2)"
fi

0 comments on commit 100f8e5

Please sign in to comment.