From 8bec7c3995e6207a192575d2be613ffed25d929c Mon Sep 17 00:00:00 2001 From: Fan Yong Date: Sun, 6 Apr 2014 08:39:14 +0800 Subject: [PATCH] LU-4980 tests: enhance sanity-scrub test_11 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 Change-Id: I2bde83a5c03910216070cc23d01785624d829af4 Reviewed-on: http://review.whamcloud.com/10214 Tested-by: Jenkins Reviewed-by: Bobi Jam Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- lustre/tests/sanity-scrub.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lustre/tests/sanity-scrub.sh b/lustre/tests/sanity-scrub.sh index fdbd97f..04d916b 100644 --- a/lustre/tests/sanity-scrub.sh +++ b/lustre/tests/sanity-scrub.sh @@ -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 6 -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 -- 1.8.3.1