Whamcloud - gitweb
LU-1804 tests: skip OI scrub speed test under UP env
[fs/lustre-release.git] / lustre / tests / sanity-scrub.sh
index aa32eb7..1ce2737 100644 (file)
@@ -322,7 +322,8 @@ test_6() {
        diff -q $LUSTRE/tests/test-framework.sh $DIR/$tdir/test-framework.sh ||
                error "(6) File diff failed unexpected!"
 
-       sleep 8
+       # Sleep 5 sec to guarantee at least one object processed by OI scrub
+       sleep 5
        # Fail the OI scrub to guarantee there is at least one checkpoint
        #define OBD_FAIL_OSD_SCRUB_FATAL         0x192
        do_facet $SINGLEMDS $LCTL set_param fail_loc=0x80000192
@@ -347,7 +348,7 @@ test_6() {
        #define OBD_FAIL_OSD_SCRUB_CRASH         0x191
        do_facet $SINGLEMDS $LCTL set_param fail_loc=0x80000191
        sleep 4
-       local POSITION0=$($SHOW_SCRUB | \
+       local POSITION0=$($SHOW_SCRUB |
                        awk '/^last_checkpoint_position/ {print $2}')
        POSITION0=$((POSITION0 + 1))
 
@@ -365,7 +366,7 @@ test_6() {
        [ "$STATUS" == "scanning" ] ||
                error "(13) Expect 'scanning', but got '$STATUS'"
 
-       local POSITION1=$($SHOW_SCRUB | \
+       local POSITION1=$($SHOW_SCRUB |
                        awk '/^latest_start_position/ {print $2}')
        [ $POSITION0 -eq $POSITION1 ] ||
                error "(14) Expect position: $POSITION0, but got $POSITION1"
@@ -481,6 +482,11 @@ test_8() {
 run_test 8 "Control OI scrub manually"
 
 test_9() {
+       if [ -z "$(grep "processor.*: 1" /proc/cpuinfo)" ]; then
+               skip "Testing on UP system, the speed may be inaccurate."
+               return 0
+       fi
+
        scrub_prep 8000
        mds_backup_restore || error "(1) Fail to backup/restore!"
 
@@ -531,9 +537,8 @@ test_9() {
        [ $SPEED -lt 220 ] &&
                error "(11) Unexpected speed $SPEED, should not less than 220"
 
-       # (1024 + 100 * 10 + 300 * 10) / 20
-       [ $SPEED -gt 270 ] &&
-               error "(12) Unexpected speed $SPEED, should not more than 270"
+       [ $SPEED -gt 300 ] &&
+               error "(12) Unexpected speed $SPEED, should not more than 300"
 
        do_facet $SINGLEMDS \
                $LCTL set_param -n mdd.${MDT_DEV}.lfsck_speed_limit 0