diff --git a/src/tests/lxc-test-apparmor-generated b/src/tests/lxc-test-apparmor-generated index 59b7472c5..15b6a1128 100755 --- a/src/tests/lxc-test-apparmor-generated +++ b/src/tests/lxc-test-apparmor-generated @@ -18,7 +18,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -if ! which apparmor_parser >/dev/null 2>&1; then +if ! command -v apparmor_parser >/dev/null 2>&1; then echo 'SKIP: test for generated apparmor profiles: apparmor_parser missing' fi exit 0 diff --git a/src/tests/lxc-test-apparmor-mount b/src/tests/lxc-test-apparmor-mount index 663caf2c5..7c9d9ad50 100755 --- a/src/tests/lxc-test-apparmor-mount +++ b/src/tests/lxc-test-apparmor-mount @@ -91,7 +91,7 @@ chmod 0666 "$logfile" # of an empty directory over the securityfs 'mount' directory # be removed, we need to do this as non-root. -which newuidmap >/dev/null 2>&1 || { echo "'newuidmap' command is missing" >&2; exit 1; } +command -v newuidmap >/dev/null 2>&1 || { echo "'newuidmap' command is missing" >&2; exit 1; } # create a test user TUSER=lxcunpriv HDIR=/home/$TUSER @@ -119,7 +119,7 @@ chown -R $TUSER: /run/user/$(id -u $TUSER) cd $HDIR -if which cgm >/dev/null 2>&1; then +if command -v cgm >/dev/null 2>&1; then cgm create all $TUSER cgm chown all $TUSER $(id -u $TUSER) $(id -g $TUSER) cgm movepid all $TUSER $$ diff --git a/src/tests/lxc-test-unpriv b/src/tests/lxc-test-unpriv index 345656906..8fb9106d6 100755 --- a/src/tests/lxc-test-unpriv +++ b/src/tests/lxc-test-unpriv @@ -62,7 +62,7 @@ if modprobe -q overlayfs; then fi fi -which newuidmap >/dev/null 2>&1 || { echo "'newuidmap' command is missing" >&2; exit 1; } +command -v newuidmap >/dev/null 2>&1 || { echo "'newuidmap' command is missing" >&2; exit 1; } DONE=0 UNPRIV_LOG=$(mktemp --dry-run) @@ -130,7 +130,7 @@ chown -R $TUSER: /run/user/$(id -u $TUSER) cd $HDIR -if which cgm >/dev/null 2>&1; then +if command -v cgm >/dev/null 2>&1; then cgm create all $TUSER cgm chown all $TUSER $(id -u $TUSER) $(id -g $TUSER) cgm movepid all $TUSER $$ @@ -181,7 +181,7 @@ p1=$(run_cmd lxc-info -n c2 -p -H -l trace -o "${UNPRIV_LOG}") run_cmd lxc-stop -n c2 -k -l trace -o "${UNPRIV_LOG}" -if which cgm >/dev/null 2>&1; then +if command -v cgm >/dev/null 2>&1; then echo "Testing containers under different cgroups per subsystem" run_cmd cgm create freezer x1/x2 cgm movepid freezer x1 $$ diff --git a/src/tests/lxc-test-usernic.in b/src/tests/lxc-test-usernic.in index 47fa62db5..848ff561c 100755 --- a/src/tests/lxc-test-usernic.in +++ b/src/tests/lxc-test-usernic.in @@ -80,7 +80,7 @@ lxc.idmap = u 0 910000 10000 lxc.idmap = g 0 910000 10000 EOF -if which cgm >/dev/null 2>&1; then +if command -v cgm >/dev/null 2>&1; then cgm create all usernic-user cgm chown all usernic-user $(id -u usernic-user) $(id -g usernic-user) cgm movepid all usernic-user $$