tests: prune cat (ab)uses

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #13259
This commit is contained in:
наб
2022-03-14 23:47:38 +01:00
committed by Brian Behlendorf
parent f7cc8dddf7
commit b2c5291b7e
16 changed files with 51 additions and 67 deletions
@@ -30,7 +30,7 @@
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/xattr/xattr_common.kshlib
USES_NIS=$(cat $TEST_BASE_DIR/zfs-xattr-test-nis.txt)
USES_NIS=$(<$TEST_BASE_DIR/zfs-xattr-test-nis.txt)
rm $TEST_BASE_DIR/zfs-xattr-test-nis.txt
if [ "${USES_NIS}" == "true" ]
@@ -97,10 +97,10 @@ function delete_xattr { # filename xattr_name
if is_illumos; then
log_must runat $FILE rm $XATTR_NAME
log_mustnot eval "runat $FILE ls $XATTR_NAME > /dev/null 2>&1"
else
log_must rm_xattr $XATTR_NAME $FILE
log_mustnot get_xattr $XATTR_NAME $FILE
fi
else
log_must rm_xattr $XATTR_NAME $FILE
log_mustnot get_xattr $XATTR_NAME $FILE
fi
}
# not sure about this : really this should be testing write/append
@@ -126,12 +126,6 @@ function verify_write_xattr { # filename xattr_name
function create_expected_output { # expected_output_file contents_of_the_output
typeset FILE=$1
shift
if [[ -f $FILE ]]; then
log_must rm $FILE
fi
for line in $@
do
log_must eval "echo $line >> $FILE"
done
log_must rm -f $FILE
log_must eval "printf '%s\n' $* >> $FILE"
}