Forgot to modify and include the tests in previous PR, so do that now.
Signed-off-by: Diederik de Haas <didi.debian@cknow.org>
# 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
# 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
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 $$
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)
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 $$
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 $$
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 $$