diff options
author | loli10K <[email protected]> | 2019-05-24 23:04:08 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-05-24 14:04:08 -0700 |
commit | 2696e86f2b5c6dfb66fb809d7070ffb2c25b3f28 (patch) | |
tree | bc8eea89a886901bd684d6c9cd2632b54bf6eb41 /tests | |
parent | b868525bf7577e1e83634471eaac8805d9ed5481 (diff) |
zfs-tests: verify zfs(8) and zpool(8) help message is under 80 columns
This commit updates the ZFS Test Suite to detect incorrect wrapping of
both zfs(8) and zpool(8) help message
Reviewed by: John Kennedy <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: loli10K <[email protected]>
Closes #8785
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/zfs-tests/tests/functional/cli_user/misc/zfs_001_neg.ksh | 12 | ||||
-rwxr-xr-x | tests/zfs-tests/tests/functional/cli_user/misc/zpool_001_neg.ksh | 12 |
2 files changed, 16 insertions, 8 deletions
diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_001_neg.ksh index 1073a4030..46171caf9 100755 --- a/tests/zfs-tests/tests/functional/cli_user/misc/zfs_001_neg.ksh +++ b/tests/zfs-tests/tests/functional/cli_user/misc/zfs_001_neg.ksh @@ -44,16 +44,20 @@ function cleanup { - if [ -e $TEST_BASE_DIR/zfs_001_neg.$$.txt ] + if [ -e "$TEMPFILE" ] then - rm $TEST_BASE_DIR/zfs_001_neg.$$.txt + rm -f "$TEMPFILE" fi } log_onexit cleanup log_assert "zfs shows a usage message when run as a user" -eval "zfs > $TEST_BASE_DIR/zfs_001_neg.$$.txt 2>&1" -log_must grep "usage: zfs command args" $TEST_BASE_DIR/zfs_001_neg.$$.txt +TEMPFILE="$TEST_BASE_DIR/zfs_001_neg.$$.txt" + +eval "zfs > $TEMPFILE 2>&1" +log_must grep "usage: zfs command args" "$TEMPFILE" + +log_must eval "awk '{if (length(\$0) > 80) exit 1}' < $TEMPFILE" log_pass "zfs shows a usage message when run as a user" diff --git a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_001_neg.ksh b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_001_neg.ksh index af924837a..0fddc08b2 100755 --- a/tests/zfs-tests/tests/functional/cli_user/misc/zpool_001_neg.ksh +++ b/tests/zfs-tests/tests/functional/cli_user/misc/zpool_001_neg.ksh @@ -45,16 +45,20 @@ function cleanup { - if [ -e $TEST_BASE_DIR/zpool_001_neg.$$.txt ] + if [ -e "$TEMPFILE" ] then - rm $TEST_BASE_DIR/zpool_001_neg.$$.txt + rm -f "$TEMPFILE" fi } +TEMPFILE="$TEST_BASE_DIR/zpool_001_neg.$$.txt" + log_onexit cleanup log_assert "zpool shows a usage message when run as a user" -eval "zpool > $TEST_BASE_DIR/zpool_001_neg.$$.txt 2>&1" -log_must grep "usage: zpool command args" $TEST_BASE_DIR/zpool_001_neg.$$.txt +eval "zpool > $TEMPFILE 2>&1" +log_must grep "usage: zpool command args" "$TEMPFILE" + +log_must eval "awk '{if (length(\$0) > 80) exit 1}' < $TEMPFILE" log_pass "zpool shows a usage message when run as a user" |