mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
common: add names device mounted errors
This adds user friendly prompts to output the already mounted point from _mount. xfstests will do the cleanup (ie. umount) and user can not get the mount name information when directory is already mounted. Signed-off-by: Jia He <hejianet@gmail.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
@@ -1266,12 +1266,15 @@ _require_scratch_nocheck()
|
|||||||
# mounted?
|
# mounted?
|
||||||
# Note that we use -F here so grep doesn't try to interpret an NFS over
|
# Note that we use -F here so grep doesn't try to interpret an NFS over
|
||||||
# IPv6 server as a regular expression.
|
# IPv6 server as a regular expression.
|
||||||
if _mount | grep -F -q $SCRATCH_DEV
|
mount_rec=`_mount | grep -F $SCRATCH_DEV`
|
||||||
|
if [ "$mount_rec" ]
|
||||||
then
|
then
|
||||||
# if it's mounted, make sure its on $SCRATCH_MNT
|
# if it's mounted, make sure its on $SCRATCH_MNT
|
||||||
if ! _mount | grep -F $SCRATCH_DEV | grep -q $SCRATCH_MNT
|
if ! echo $mount_rec | grep -q $SCRATCH_MNT
|
||||||
then
|
then
|
||||||
echo "\$SCRATCH_DEV is mounted but not on \$SCRATCH_MNT - aborting"
|
echo "\$SCRATCH_DEV=$SCRATCH_DEV is mounted but not on \$SCRATCH_MNT=$SCRATCH_MNT - aborting"
|
||||||
|
echo "Already mounted result:"
|
||||||
|
echo $mount_rec
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# and then unmount it
|
# and then unmount it
|
||||||
@@ -1348,12 +1351,15 @@ _require_test()
|
|||||||
# mounted?
|
# mounted?
|
||||||
# Note that we use -F here so grep doesn't try to interpret an NFS over
|
# Note that we use -F here so grep doesn't try to interpret an NFS over
|
||||||
# IPv6 server as a regular expression.
|
# IPv6 server as a regular expression.
|
||||||
if _mount | grep -F -q $TEST_DEV
|
mount_rec=`_mount | grep -F $TEST_DEV`
|
||||||
|
if [ "$mount_rec" ]
|
||||||
then
|
then
|
||||||
# if it's mounted, make sure its on $TEST_DIR
|
# if it's mounted, make sure its on $TEST_DIR
|
||||||
if ! _mount | grep -F $TEST_DEV | grep -q $TEST_DIR
|
if ! echo $mount_rec | grep -q $TEST_DIR
|
||||||
then
|
then
|
||||||
echo "\$TEST_DEV is mounted but not on \$TEST_DIR - aborting"
|
echo "\$TEST_DEV=$TEST_DEV is mounted but not on \$TEST_DIR=$TEST_DIR - aborting"
|
||||||
|
echo "Already mounted result:"
|
||||||
|
echo $mount_rec
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user