Whamcloud - gitweb
LU-1634 test: Check client only for version matching
authorJinshan Xiong <jinshan.xiong@whamcloud.com>
Wed, 1 Aug 2012 20:18:48 +0000 (13:18 -0700)
committerOleg Drokin <green@whamcloud.com>
Mon, 13 Aug 2012 05:08:12 +0000 (01:08 -0400)
For reliability, we should check nidtbl versions on the client only
to make sure the client is not notified if IR on the MGS is disabled.
Otherwise, if the MGS can't respond while OST is restarting, the
nidtbl version won't be updated and this will fail the test.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: I903add4261f5fb133ae4ac170b10c0783c226e29
Reviewed-on: http://review.whamcloud.com/3511
Tested-by: Hudson
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/recovery-small.sh

index 0f379a7..c89558a 100755 (executable)
@@ -1276,19 +1276,30 @@ target_instance_match()
 
 test_100()
 {
 
 test_100()
 {
-        do_facet mgs $LCTL list_param mgs.*.ir_timeout ||
-                { skip "MGS without IR support"; return 0; }
+       do_facet mgs $LCTL list_param mgs.*.ir_timeout ||
+               { skip "MGS without IR support"; return 0; }
+
+       # MDT was just restarted in the previous test, make sure everything
+       # is all set.
+       local cnt=30
+       while [ $cnt -gt 0 ]; do
+               nidtbl_versions_match && break
+               sleep 1
+               cnt=$((cnt - 1))
+       done
+
+       # disable IR
+       set_ir_status disabled
 
 
-        # disable IR
-        set_ir_status disabled
+       local prev_ver=$(nidtbl_version_client client)
 
         local saved_FAILURE_MODE=$FAILURE_MODE
         [ $(facet_host mgs) = $(facet_host ost1) ] && FAILURE_MODE="SOFT"
         fail ost1
 
         # valid check
 
         local saved_FAILURE_MODE=$FAILURE_MODE
         [ $(facet_host mgs) = $(facet_host ost1) ] && FAILURE_MODE="SOFT"
         fail ost1
 
         # valid check
-        nidtbl_versions_match &&
-                error "version must differ due to IR disabled"
+       [ $(nidtbl_version_client client) -eq $prev_ver ] ||
+               error "version must not change due to IR disabled"
         target_instance_match ost1 || error "instance mismatch"
 
         # restore env
         target_instance_match ost1 || error "instance mismatch"
 
         # restore env