From 100f8e5d186ee3f2c6c3bf8397fbe201674b57e7 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Tue, 28 Jan 2025 15:45:16 +0100 Subject: [PATCH] btrfs-progs: tests: add cases to combine --help with other options Signed-off-by: David Sterba --- tests/cli-tests/001-btrfs/test.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/cli-tests/001-btrfs/test.sh b/tests/cli-tests/001-btrfs/test.sh index 85213fccf0..ef828f80f8 100755 --- a/tests/cli-tests/001-btrfs/test.sh +++ b/tests/cli-tests/001-btrfs/test.sh @@ -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