tests: get rid of which

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-09 13:52:14 +01:00 committed by Brian Behlendorf
parent 62c5ccdf92
commit 592cf7f1e2
5 changed files with 6 additions and 11 deletions

View File

@ -109,8 +109,7 @@ export SYSTEM_FILES_COMMON='arp
uuidgen uuidgen
vmstat vmstat
wait wait
wc wc'
which'
export SYSTEM_FILES_FREEBSD='chflags export SYSTEM_FILES_FREEBSD='chflags
compress compress

View File

@ -2618,7 +2618,7 @@ function add_user_linux #<group_name> <user_name> <basedir>
# Add new users to the same group and the command line utils. # Add new users to the same group and the command line utils.
# This allows them to be run out of the original users home # This allows them to be run out of the original users home
# directory as long as it permissioned to be group readable. # directory as long as it permissioned to be group readable.
cmd_group=$(stat --format="%G" $(which zfs)) cmd_group=$(stat --format="%G" $(command -v zfs))
log_must usermod -a -G $cmd_group $user log_must usermod -a -G $cmd_group $user
return 0 return 0

View File

@ -42,9 +42,7 @@ verify_runnable "global"
log_assert "verify mmap'd pages work with libaio" log_assert "verify mmap'd pages work with libaio"
# mmap_libaio is built when the libaio-devel package is installed. # mmap_libaio is built when the libaio-devel package is installed.
if ! which mmap_libaio; then command -v mmap_libaio > /dev/null || log_unsupported "This test requires mmap_libaio."
log_unsupported "This test requires mmap_libaio."
fi
log_must chmod 777 $TESTDIR log_must chmod 777 $TESTDIR

View File

@ -22,9 +22,7 @@
. $STF_SUITE/tests/functional/pam/utilities.kshlib . $STF_SUITE/tests/functional/pam/utilities.kshlib
if ! which pamtester; then command -v pamtester > /dev/null || log_unsupported "pam tests require the pamtester utility to be installed"
log_unsupported "pam tests require the pamtester utility to be installed"
fi
DISK=${DISKS%% *} DISK=${DISKS%% *}
create_pool $TESTPOOL "$DISK" create_pool $TESTPOOL "$DISK"

View File

@ -51,8 +51,8 @@ log_onexit cleanup
log_assert "Check root in user namespaces" log_assert "Check root in user namespaces"
TOUCH=$(readlink -e $(which touch)) TOUCH=$(readlink -f $(command -v touch))
CHMOD=$(readlink -e $(which chmod)) CHMOD=$(readlink -f $(command -v chmod))
for i in ${files[*]}; do for i in ${files[*]}; do
log_must $TOUCH $TESTDIR/$i log_must $TOUCH $TESTDIR/$i