Whamcloud - gitweb
LU-1999 test: LW conn test should rely on debug logs
authorJohann Lombardi <johann.lombardi@intel.com>
Wed, 17 Oct 2012 21:39:50 +0000 (23:39 +0200)
committerOleg Drokin <green@whamcloud.com>
Thu, 18 Oct 2012 19:17:22 +0000 (15:17 -0400)
Recovery-small test 6 should rely on lustre debug logs instead of
dmesg since console messages are rate limited and might not be printed
as expected by the test.

The test should also be skipped if the server does not support
lightweight connections (i.e. is older than 2.3.50).

Signed-off-by: Johann Lombardi <johann.lombardi@intel.com>
Change-Id: I78994831506e632f1730eb6f80fe145c7fc2cf3e
Reviewed-on: http://review.whamcloud.com/4288
Tested-by: Hudson
Reviewed-by: Li Wei <liwei@whamcloud.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/recovery-small.sh

index a1ca789..aba5353 100755 (executable)
@@ -1497,12 +1497,17 @@ run_test 105 "IR: NON IR clients support"
 cleanup_106() {
        trap 0
        umount_client $DIR2
+       debugrestore
 }
 
 test_106() { # LU-1789
+       [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.3.50) ]] ||
+               { skip "Need MDS version at least 2.3.50"; return 0; }
+
 #define OBD_FAIL_MDC_LIGHTWEIGHT         0x805
        $LCTL set_param fail_loc=0x805
 
+       debugsave
        trap cleanup_106 EXIT
 
        # enable lightweight flag on mdc connection
@@ -1515,16 +1520,17 @@ test_106() { # LU-1789
 
        touch $DIR2/$tfile || error "failed to create empty file"
        replay_barrier $SINGLEMDS
+
+       $LCTL set_param debug=console
+       $LCTL clear
        facet_failover $SINGLEMDS
 
        # lightweight connection must be evicted
        touch -c $DIR2/$tfile || true
-       evicted=`dmesg | awk '/test 106/ {start = 1;}
-                             /This client was evicted by .*MDT0000/ {
-                                     if (start) {
-                                             print;
-                                     }
-                             }'`
+       $LCTL dk $TMP/lustre-log-$TESTNAME.log
+       evicted=`awk '/This client was evicted by .*MDT0000/ {
+                                     print;
+                     }' $TMP/lustre-log-$TESTNAME.log`
        [ -z "$evicted" ] && error "lightweight client not evicted by mds"
 
        # and all operations performed by lightweight client should be