+run_test 14 "OI scrub can repair objects under lost+found"
+
+test_15() {
+ local server_version=$(lustre_version_code $SINGLEMDS)
+ scrub_prep 20
+ scrub_backup_restore 1
+ echo "starting MDTs with OI scrub disabled"
+ scrub_start_mds 2 "$MOUNT_OPTS_NOSCRUB"
+ scrub_check_status 3 init
+ scrub_check_flags 4 recreated,inconsistent
+
+ # run under dryrun mode
+ if [ $server_version -lt $(version_code 2.5.58) ]; then
+ scrub_start 5 --dryrun on
+ else
+ scrub_start 5 --dryrun
+ fi
+ scrub_check_status 6 completed
+ scrub_check_flags 7 recreated,inconsistent
+ scrub_check_params 8 dryrun
+ scrub_check_repaired 9 20
+
+ # run under dryrun mode again
+ if [ $server_version -lt $(version_code 2.5.58) ]; then
+ scrub_start 10 --dryrun on
+ else
+ scrub_start 10 --dryrun
+ fi
+ scrub_check_status 11 completed
+ scrub_check_flags 12 recreated,inconsistent
+ scrub_check_params 13 dryrun
+ scrub_check_repaired 14 20
+
+ # run under normal mode
+ #
+ # Lustre-2.x (x <= 5) used "-n off" to disable dryrun which does not
+ # work under Lustre-2.y (y >= 6), the test script should be fixed as
+ # "-noff" or "--dryrun=off" or nothing by default.
+ if [ $server_version -lt $(version_code 2.5.58) ]; then
+ scrub_start 15 --dryrun off
+ else
+ scrub_start 15
+ fi
+ scrub_check_status 16 completed
+ scrub_check_flags 17 ""
+ scrub_check_params 18 ""
+ scrub_check_repaired 19 20
+
+ # run under normal mode again
+ if [ $server_version -lt $(version_code 2.5.58) ]; then
+ scrub_start 20 --dryrun off
+ else
+ scrub_start 20
+ fi
+ scrub_check_status 21 completed
+ scrub_check_flags 22 ""
+ scrub_check_params 23 ""
+ scrub_check_repaired 24 0
+}
+run_test 15 "Dryrun mode OI scrub"