From: Karel Zak Date: Sun, 2 Jan 2011 21:56:31 +0000 (+0100) Subject: tests: use findmnt(8) for mount --move test X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f42e1089aadbe537bb59143502ebd1767d3f7ea;p=util-linux tests: use findmnt(8) for mount --move test Signed-off-by: Karel Zak --- diff --git a/tests/ts/mount/move b/tests/ts/mount/move index bc4941d0..dfdd79a3 100755 --- a/tests/ts/mount/move +++ b/tests/ts/mount/move @@ -34,21 +34,18 @@ DIR_B="$TS_OUTDIR/mnt-move-B" $TS_CMD_MOUNT --bind $DIR_SRC $DIR_A # check the bind -egrep -q "^$DIR_SRC $DIR_A" /etc/mtab -[ "$?" == "0" ] || ts_die "Cannot found binded $DIR_SRC in /etc/mtab" +$TS_CMD_FINDMNT --kernel --target "$DIR_A" &> /dev/null +[ "$?" == "0" ] || ts_die "Cannot found binded $DIR_A in /proc/self/mountinfo" # move $TS_CMD_MOUNT --move $DIR_A $DIR_B # check the move -egrep -q "^$DIR_SRC $DIR_B" /etc/mtab -if [ "$?" != "0" ]; then - $TS_CMD_UMOUNT $DIR_SRC - ts_die "Cannot found moved $DIR_SRC in /etc/mtab" -fi +$TS_CMD_FINDMNT --kernel --target "$DIR_B" &> /dev/null +[ "$?" == "0" ] || ts_die "Cannot found binded $DIR_B in /proc/self/mountinfo" # clean up -$TS_CMD_UMOUNT $DIR_SRC +$TS_CMD_UMOUNT $DIR_B rmdir $DIR_SRC $DIR_A $DIR_B ts_log "Success"