diff options
author | Ruediger Meier | 2015-04-02 11:35:29 +0200 |
---|---|---|
committer | Ruediger Meier | 2015-04-02 12:36:44 +0200 |
commit | 4c16510cb9e34531404c431340f7c03ebd4d6a44 (patch) | |
tree | 471fca1e233a234ec1f81e37bd8eb89d14497995 /tests/ts/mount | |
parent | tests: fix, don't call ts_die from subshell (diff) | |
download | kernel-qcow2-util-linux-4c16510cb9e34531404c431340f7c03ebd4d6a44.tar.gz kernel-qcow2-util-linux-4c16510cb9e34531404c431340f7c03ebd4d6a44.tar.xz kernel-qcow2-util-linux-4c16510cb9e34531404c431340f7c03ebd4d6a44.zip |
tests: mount/rlimit tries to restore mtab
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'tests/ts/mount')
-rwxr-xr-x | tests/ts/mount/rlimit | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/ts/mount/rlimit b/tests/ts/mount/rlimit index 0edace51b..2eaeb501b 100755 --- a/tests/ts/mount/rlimit +++ b/tests/ts/mount/rlimit @@ -60,22 +60,31 @@ OLD_SUM=$(mtab_checksum) $TS_CMD_MOUNT $DEVICE $TS_MOUNTPOINT ) &> /dev/null NEW_SUM=$(mtab_checksum) -$TS_CMD_UMOUNT $TS_MOUNTPOINT &> /dev/null [ $NEW_SUM = $OLD_SUM ] && echo "OK: mtab unmodified by mount" >> $TS_OUTPUT +ts_is_mounted $DEVICE || ts_die "Cannot find $DEVICE in /proc/mounts" +$TS_CMD_UMOUNT $TS_MOUNTPOINT &> /dev/null +ts_is_mounted $DEVICE && ts_die "$DEVICE is still mounted" ts_finalize_subtest ts_init_subtest "umount" [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT $TS_CMD_MOUNT $DEVICE $TS_MOUNTPOINT &> /dev/null +ts_is_mounted $DEVICE || ts_die "Cannot find $DEVICE in /proc/mounts" OLD_SUM=$(mtab_checksum) ( ulimit -f 1 $TS_CMD_UMOUNT $TS_MOUNTPOINT &> /dev/null ) &> /dev/null NEW_SUM=$(mtab_checksum) -$TS_CMD_UMOUNT $TS_MOUNTPOINT &> /dev/null [ $NEW_SUM = $OLD_SUM ] && echo "OK: mtab unmodified by umount" >> $TS_OUTPUT +if ts_is_mounted $DEVICE; then + echo "FAIL: $DEVICE is still mounted" >> $TS_OUTPUT + $TS_CMD_UMOUNT $TS_MOUNTPOINT &> /dev/null +else + # repair /etc/mtab + $TS_CMD_UMOUNT --fake $TS_MOUNTPOINT &> /dev/null +fi ts_finalize_subtest |