Whamcloud - gitweb
b=22979 ignore the case of zero unused lock before recovery for replay-single test_85
authorFan Yong <Yong.Fan@sun.com>
Mon, 9 Aug 2010 09:02:57 +0000 (17:02 +0800)
committerJohann Lombardi <johann.lombardi@oracle.com>
Tue, 10 Aug 2010 08:33:06 +0000 (10:33 +0200)
Ignore the case of zero unused lock before recovery for replay-single test_85.

i=johann.lombardi
i=Hongchao.zhang

lustre/tests/replay-single.sh

index af6cb75..645efd6 100644 (file)
@@ -2132,24 +2132,21 @@ run_test 84 "stale open during export disconnect"
 test_85a() { #bug 16774
     lctl set_param -n ldlm.cancel_unused_locks_before_replay "1"
 
-    for i in `seq 100`; do
-        echo "tag-$i" > $DIR/$tfile-$i
-        grep -q "tag-$i" $DIR/$tfile-$i || error "f2-$i"
-    done
+    createmany -o $DIR/$tfile- 100
+    ls -l $DIR/ > /dev/null
 
     lov_id=`lctl dl | grep "clilov"` 
     addr=`echo $lov_id | awk '{print $4}' | awk -F '-' '{print $3}'`
     count=`lctl get_param -n ldlm.namespaces.*MDT0000*$addr.lock_unused_count`
     echo "before recovery: unused locks count = $count"
+    [ $count -ne 0 ] || error "unused locks should not be zero before recovery"
 
     fail mds
     
     count2=`lctl get_param -n ldlm.namespaces.*MDT0000*$addr.lock_unused_count`
     echo "after recovery: unused locks count = $count2"
 
-    if [ $count2 -ge $count ]; then
-        error "unused locks are not canceled"
-    fi
+    [ $count2 -lt $count ] || error "unused locks are not canceled"
 }
 run_test 85a "check the cancellation of unused locks during recovery(IBITS)"