@@ -214,6 +214,8 @@ simply by setting right '$TST_FOO'.
https://github.com/linux-test-project/ltp/wiki/Shell-Test-API#formatting-device-with-a-filesystem[Formatting device with a filesystem].
| 'TST_MNT_PARAMS' | Extra mount params for 'tst_mount', see
https://github.com/linux-test-project/ltp/wiki/Shell-Test-API#formatting-device-with-a-filesystem[Formatting device with a filesystem].
+| 'TST_MOUNT_DEVICE' | Mount device, see
+ https://github.com/linux-test-project/ltp/wiki/Shell-Test-API#mounting-and-unmounting-filesystems[Mounting and unmounting filesystems].
| 'TST_NEEDS_ROOT' | Exit the test with 'TCONF' unless executed under root.
Alternatively the 'tst_require_root' command can be used.
| 'TST_NEEDS_TMPDIR' | Create test temporary directory and cd into it.
@@ -41,6 +41,10 @@ _tst_do_exit()
fi
fi
+ if [ "$TST_MOUNT_FLAG" = 1 ]; then
+ tst_umount
+ fi
+
if [ "$TST_NEEDS_DEVICE" = 1 -a "$TST_DEVICE_FLAG" = 1 ]; then
if ! tst_device release "$TST_DEVICE"; then
tst_res TWARN "Failed to release device '$TST_DEVICE'"
@@ -632,7 +636,7 @@ tst_run()
NET_SKIP_VARIABLE_INIT|NEEDS_CHECKPOINTS);;
CHECKPOINT_WAIT|CHECKPOINT_WAKE);;
CHECKPOINT_WAKE2|CHECKPOINT_WAKE_AND_WAIT);;
- DEV_EXTRA_OPTS|DEV_FS_OPTS|FORMAT_DEVICE);;
+ DEV_EXTRA_OPTS|DEV_FS_OPTS|FORMAT_DEVICE|MOUNT_DEVICE);;
*) tst_res TWARN "Reserved variable TST_$_tst_i used!";;
esac
done
@@ -666,6 +670,7 @@ tst_run()
_tst_setup_timer
+ [ "$TST_MOUNT_DEVICE" = 1 ] && TST_FORMAT_DEVICE=1
[ "$TST_FORMAT_DEVICE" = 1 ] && TST_NEEDS_DEVICE=1
[ "$TST_NEEDS_DEVICE" = 1 ] && TST_NEEDS_TMPDIR=1
@@ -702,6 +707,11 @@ tst_run()
tst_mkfs $TST_FS_TYPE $TST_DEV_FS_OPTS $TST_DEVICE $TST_DEV_EXTRA_OPTS
fi
+ if [ "$TST_MOUNT_DEVICE" = 1 ]; then
+ tst_mount
+ TST_MOUNT_FLAG=1
+ fi
+
[ -n "$TST_NEEDS_CHECKPOINTS" ] && _tst_init_checkpoints
if [ -n "$TST_SETUP" ]; then