diff --git a/test/zdtm_umount_cgroups b/test/zdtm_umount_cgroups index decd70ff00..64e54ccb7b 100755 --- a/test/zdtm_umount_cgroups +++ b/test/zdtm_umount_cgroups @@ -7,12 +7,13 @@ cat /proc/self/cgroup | grep -q zdtmtst.defaultroot || exit 0 uuid=$1 tdir=`mktemp -d zdtm.XXXXXX` +set -e for i in "zdtmtst" "zdtmtst.defaultroot"; do - mount -t cgroup -o none,name=$i zdtm $tdir || { rmdir $tdir; exit 1; } + mount -t cgroup -o none,name=$i zdtm $tdir # remove a fake group if exists if [ -d "$tdir/holder.$uuid" ]; then - rmdir $tdir/holder.$uuid || { umount -l $tdir && rmdir $tdir; exit 1; } + rmdir $tdir/holder.$uuid fi - umount -l $tdir || exit 1; + umount -l $tdir done rmdir $tdir