]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: some more mount error handling
authorRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 19 Mar 2015 16:12:15 +0000 (17:12 +0100)
committerRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 19 Mar 2015 16:12:15 +0000 (17:12 +0100)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests/ts/mount/fstab-broken
tests/ts/mount/fstab-none
tests/ts/mount/shared-subtree

index 2f0f63caebfd0914d2118ef08fe0d89c9cd0727d..57d5d2d4f55e714908904f05e957ed7a59e6c7bb 100755 (executable)
@@ -39,6 +39,7 @@ ts_fstab_close
 
 ts_init_subtest "mount"
 $TS_CMD_MOUNT $MNT &> /dev/null
+[ "$?" = "0" ] || ts_log "error: mount $MNT"
 $TS_CMD_FINDMNT --kernel --mountpoint "$MNT" &> /dev/null
 if [ "$?" != "0" ]; then
        ts_log "Cannot find $MNT in /proc/self/mountinfo"
@@ -46,11 +47,13 @@ else
        ts_log "OK"
 fi
 $TS_CMD_UMOUNT $MNT &> /dev/null
+[ "$?" = "0" ] || ts_log "error: umount $MNT"
 ts_finalize_subtest
 
 
 ts_init_subtest "mount-all"
 $TS_CMD_MOUNT -a &> /dev/null
+[ "$?" = "0" ] || ts_log "error: mount -a"
 $TS_CMD_FINDMNT --kernel --mountpoint "$MNT" &> /dev/null
 if [ "$?" != "0" ]; then
        ts_log "Cannot find $MNT in /proc/self/mountinfo"
@@ -58,6 +61,7 @@ else
        ts_log "OK"
 fi
 $TS_CMD_UMOUNT $MNT &> /dev/null
+[ "$?" = "0" ] || ts_log "error: umount $MNT"
 ts_finalize_subtest
 
 ts_fstab_clean
index f4684b11c04c56b7b52f1b8f7fe8ea84ad061842..082afe9059358177b7fd5d9e64f0b7ff287373e2 100755 (executable)
@@ -19,6 +19,7 @@ ts_fstab_add "none" "$TS_MOUNTPOINT" "tmpfs" "rw,nosuid,nodev,relatime"
 mkdir -p $TS_MOUNTPOINT
 
 $TS_CMD_MOUNT $TS_MOUNTPOINT 2>&1 >> $TS_OUTPUT
+[ "$?" = "0" ] || ts_log "error: mount $TS_MOUNTPOINT"
 
 $TS_CMD_FINDMNT --mountpoint "$TS_MOUNTPOINT" &> /dev/null
 [ $? -eq 0 ] || ts_die "Not found target (mount failed?)"
index 2f8f5b90a1976e8bcccb63d28aebdb9271ea01b7..efce11a1029fecff61ac72942fb8d483e932debe 100755 (executable)
@@ -18,6 +18,7 @@ ts_check_losetup
 
 # bind
 $TS_CMD_MOUNT --bind $TS_MOUNTPOINT $TS_MOUNTPOINT
+[ "$?" = "0" ] || ts_die "error: mount --bind"
 
 # check the bind
 $TS_CMD_FINDMNT --kernel --mountpoint $TS_MOUNTPOINT  &> /dev/null