File: test.sh

package info (click to toggle)
btrfs-progs 6.17-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,596 kB
  • sloc: ansic: 127,198; sh: 7,836; python: 1,385; makefile: 900; asm: 296
file content (44 lines) | stat: -rwxr-xr-x 1,556 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# test commands of btrfs

source "$TEST_TOP/common" || exit

check_prereq btrfs

# returns 1
run_mayfail "$TOP/btrfs" || true
run_check "$TOP/btrfs" version
run_check "$TOP/btrfs" version --
run_check "$TOP/btrfs" help
run_check "$TOP/btrfs" help --
run_check "$TOP/btrfs" help --full
run_check "$TOP/btrfs" --help
run_check "$TOP/btrfs" --help --full
run_check "$TOP/btrfs" --version
run_check "$TOP/btrfs" --version --help

# Log levels
run_check "$TOP/btrfs" --log=default help
run_check "$TOP/btrfs" --log=info help
run_check "$TOP/btrfs" -vv help
run_check "$TOP/btrfs" --log=verbose help
run_check "$TOP/btrfs" -vvv help
run_check "$TOP/btrfs" --log=debug help
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