Whamcloud - gitweb
LU-4980 tests: enhance sanity-scrub test_11 14/10214/2
authorFan Yong <fan.yong@intel.com>
Sun, 6 Apr 2014 00:39:14 +0000 (08:39 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 29 May 2014 15:56:23 +0000 (15:56 +0000)
If there are new objects created during the OI scrub re-scanning,
then the new created objects will not be skipped by OI scrub this
time. The test should record the total checked objects count for
each cycle scanning to avoid unnecessary check failure.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I2bde83a5c03910216070cc23d01785624d829af4
Reviewed-on: http://review.whamcloud.com/10214
Tested-by: Jenkins
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity-scrub.sh

index fdbd97f..04d916b 100644 (file)
@@ -854,6 +854,9 @@ test_11() {
        sleep 3
        scrub_check_status 4 completed
 
+       declare -a checked0
+       declare -a checked1
+
        # OI scrub should skip the new created objects for the first accessing
        # notice we're creating a new llog for every OST on every startup
        # new features can make this even less stable, so we only check
@@ -865,17 +868,21 @@ test_11() {
                [ $SKIPPED -ge $MAXIMUM -o $SKIPPED -lt $MINIMUM ] &&
                        error "(5) Expect [ $MINIMUM , $MAXIMUM ) objects" \
                                "skipped on mds$n, but got $SKIPPED"
+
+               checked0[$n]=$(scrub_status $n | awk '/^checked/ { print $2 }')
        done
 
        # reset OI scrub start point by force
-       scrub_start -r
+       scrub_start -r
        sleep 3
        scrub_check_status 7 completed
 
        # OI scrub should skip the new created object only once
        for n in $(seq $MDSCOUNT); do
                SKIPPED=$(scrub_status $n | awk '/^noscrub/ { print $2 }')
-               [ $SKIPPED -eq 0 ] ||
+               checked1[$n]=$(scrub_status $n | awk '/^checked/ { print $2 }')
+
+               [ ${checked0[$n]} -ne ${checked1[$n]} -o $SKIPPED -eq 0 ] ||
                        error "(8) Expect 0 objects skipped on mds$n, but" \
                                "got $SKIPPED"
        done