tests: zfs_002_pos: simplify ZFS_ABORT tests

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12996
This commit is contained in:
наб 2022-02-23 02:39:04 +01:00 committed by Brian Behlendorf
parent e09762c6c2
commit 85c2cce51c

View File

@ -108,12 +108,8 @@ fi
log_must export ZFS_ABORT=yes log_must export ZFS_ABORT=yes
for subcmd in "${cmds[@]}" "${badparams[@]}"; do for subcmd in "${cmds[@]}" "${badparams[@]}"; do
zfs $subcmd >/dev/null 2>&1 && log_fail "$subcmd passed incorrectly." log_mustnot eval "zfs $subcmd >/dev/null 2>&1"
if [[ ! -e $corefile ]]; then log_must rm $corefile
log_fail "zfs $subcmd cannot generate core file with " \
"ZFS_ABORT set."
fi
log_must rm -f $corefile
done done
log_pass "With ZFS_ABORT set, zfs command can abort and generate core file " \ log_pass "With ZFS_ABORT set, zfs command can abort and generate core file " \