+scrub_check_flags() {
+ local error_id=$1
+ local expected=$2
+ local actual
+ local n
+
+ for n in $(seq $MDSCOUNT); do
+ actual=$(do_facet mds$n $LCTL get_param -n \
+ osd-ldiskfs.$(facet_svc mds$n).oi_scrub |
+ awk '/^flags/ { print $2 }')
+ if [ "$actual" != "$expected" ]; then
+ error "($error_id) Expected '$expected' on mds$n, but" \
+ "got '$actual'"
+ fi
+ done
+}
+
+scrub_check_data() {
+ local error_id=$1
+ local n
+
+ for n in $(seq $MDSCOUNT); do
+ diff -q $LUSTRE/tests/test-framework.sh \
+ $DIR/$tdir/mds$n/test-framework.sh ||
+ error "($error_id) File data check failed"
+ done
+}
+
+scrub_remove_ois() {
+ local error_id=$1
+ local index=$2
+ local n
+
+ for n in $(seq $MDSCOUNT); do
+ mds_remove_ois mds$n $index ||
+ error "($error_id) Failed to remove OI .$index on mds$n"
+ done
+}
+
+scrub_backup_restore() {
+ local error_id=$1
+ local igif=$2
+ local n
+
+ for n in $(seq $MDSCOUNT); do
+ mds_backup_restore mds$n $igif ||
+ error "(error_id) Backup/restore on mds$n failed"
+ done
+}
+
+scrub_enable_auto() {
+ local n
+
+ for n in $(seq $MDSCOUNT); do
+ do_facet mds$n $LCTL set_param -n \
+ osd-ldiskfs.$(facet_svc mds$n).auto_scrub 1
+ done
+}
+
+test_0() {
+ scrub_prep 0
+ echo "starting MDTs without disabling OI scrub"
+ scrub_start_mds 1 "$MOUNT_OPTS_SCRUB"
+ scrub_check_status 2 init
+ scrub_check_flags 3 ""
+ mount_client $MOUNT || error "(4) Fail to start client!"
+ scrub_check_data 5