diff --git a/tests/zfs-tests/include/commands.cfg b/tests/zfs-tests/include/commands.cfg index 50449633ac..a5ee92071b 100644 --- a/tests/zfs-tests/include/commands.cfg +++ b/tests/zfs-tests/include/commands.cfg @@ -109,8 +109,7 @@ export SYSTEM_FILES_COMMON='arp uuidgen vmstat wait - wc - which' + wc' export SYSTEM_FILES_FREEBSD='chflags compress diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib index a78c10ce2e..f786f05e8a 100644 --- a/tests/zfs-tests/include/libtest.shlib +++ b/tests/zfs-tests/include/libtest.shlib @@ -2618,7 +2618,7 @@ function add_user_linux # # Add new users to the same group and the command line utils. # This allows them to be run out of the original users home # 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 return 0 diff --git a/tests/zfs-tests/tests/functional/mmap/mmap_libaio_001_pos.ksh b/tests/zfs-tests/tests/functional/mmap/mmap_libaio_001_pos.ksh index 36a7e76f9f..031d90c383 100755 --- a/tests/zfs-tests/tests/functional/mmap/mmap_libaio_001_pos.ksh +++ b/tests/zfs-tests/tests/functional/mmap/mmap_libaio_001_pos.ksh @@ -42,9 +42,7 @@ verify_runnable "global" log_assert "verify mmap'd pages work with libaio" # mmap_libaio is built when the libaio-devel package is installed. -if ! which mmap_libaio; then - log_unsupported "This test requires mmap_libaio." -fi +command -v mmap_libaio > /dev/null || log_unsupported "This test requires mmap_libaio." log_must chmod 777 $TESTDIR diff --git a/tests/zfs-tests/tests/functional/pam/setup.ksh b/tests/zfs-tests/tests/functional/pam/setup.ksh index 23515a598e..8ef9fbe0fe 100755 --- a/tests/zfs-tests/tests/functional/pam/setup.ksh +++ b/tests/zfs-tests/tests/functional/pam/setup.ksh @@ -22,9 +22,7 @@ . $STF_SUITE/tests/functional/pam/utilities.kshlib -if ! which pamtester; then - log_unsupported "pam tests require the pamtester utility to be installed" -fi +command -v pamtester > /dev/null || log_unsupported "pam tests require the pamtester utility to be installed" DISK=${DISKS%% *} create_pool $TESTPOOL "$DISK" diff --git a/tests/zfs-tests/tests/functional/user_namespace/user_namespace_001.ksh b/tests/zfs-tests/tests/functional/user_namespace/user_namespace_001.ksh index 6be30ab4d2..3d19c4273e 100755 --- a/tests/zfs-tests/tests/functional/user_namespace/user_namespace_001.ksh +++ b/tests/zfs-tests/tests/functional/user_namespace/user_namespace_001.ksh @@ -51,8 +51,8 @@ log_onexit cleanup log_assert "Check root in user namespaces" -TOUCH=$(readlink -e $(which touch)) -CHMOD=$(readlink -e $(which chmod)) +TOUCH=$(readlink -f $(command -v touch)) +CHMOD=$(readlink -f $(command -v chmod)) for i in ${files[*]}; do log_must $TOUCH $TESTDIR/$i