Whamcloud - gitweb
LU-3143 tests: pass correct facet to wait_osc_import_state()
authorJian Yu <jian.yu@intel.com>
Mon, 22 Apr 2013 11:12:58 +0000 (19:12 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 25 Apr 2013 17:04:48 +0000 (13:04 -0400)
This patch fixes recovery-small test 29a and some other tests
to pass correct facet to wait_osc_import_state(), which will
make the tests pass under failover configuration.

Test-Parameters: envdefinitions=SLOW=yes \
clientdistro=el6 serverdistro=el6 clientarch=x86_64 \
serverarch=x86_64 clientcount=4 osscount=2 mdscount=2 \
austeroptions=-R failover=true useiscsi=true \
testlist=recovery-small

Change-Id: I68b8d2f2528223a5140eed5724c2a4ffdd1988fa
Signed-off-by: Jian Yu <jian.yu@intel.com>
Reviewed-on: http://review.whamcloud.com/6100
Tested-by: Hudson
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/conf-sanity.sh
lustre/tests/ost-pools.sh
lustre/tests/recovery-small.sh
lustre/tests/test-framework.sh

index 39eb501..2bde5ee 100644 (file)
@@ -788,16 +788,12 @@ test_21d() {
 run_test 21d "start mgs then ost and then mds"
 
 test_22() {
 run_test 21d "start mgs then ost and then mds"
 
 test_22() {
-       local num
-
        start_mds
 
        echo Client mount with ost in logs, but none running
        start_ost
        # wait until mds connected to ost and open client connection
        start_mds
 
        echo Client mount with ost in logs, but none running
        start_ost
        # wait until mds connected to ost and open client connection
-       for num in $(seq 1 $MDSCOUNT); do
-               wait_osc_import_state mds${num} ost FULL
-       done
+       wait_osc_import_state mds ost FULL
        stop_ost
        mount_client $MOUNT
        # check_mount will block trying to contact ost
        stop_ost
        mount_client $MOUNT
        # check_mount will block trying to contact ost
@@ -817,9 +813,7 @@ test_22() {
                sleep $((TIMEOUT + TIMEOUT + TIMEOUT))
        fi
        mount_client $MOUNT
                sleep $((TIMEOUT + TIMEOUT + TIMEOUT))
        fi
        mount_client $MOUNT
-       for num in $(seq 1 $MDSCOUNT); do
-               wait_osc_import_state mds${num} ost FULL
-       done
+       wait_osc_import_state mds ost FULL
        wait_osc_import_state client ost FULL
        check_mount || return 41
        pass
        wait_osc_import_state client ost FULL
        check_mount || return 41
        pass
index ffa1506..6dfa7fe 100644 (file)
@@ -1388,7 +1388,6 @@ run_test 24 "Independence of pool from other setstripe parameters"
 
 test_25() {
     set_cleanup_trap
 
 test_25() {
     set_cleanup_trap
-    local dev=$(mdsdevname ${SINGLEMDS//mds/})
     local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
 
     mkdir -p $POOL_ROOT
     local POOL_ROOT=${POOL_ROOT:-$DIR/$tdir}
 
     mkdir -p $POOL_ROOT
@@ -1400,11 +1399,9 @@ test_25() {
             sort -u | tr '\n' ' ' " "$FSNAME-OST0000_UUID " >/dev/null ||
                 error "pool_add failed: $1; $2"
 
             sort -u | tr '\n' ' ' " "$FSNAME-OST0000_UUID " >/dev/null ||
                 error "pool_add failed: $1; $2"
 
-        stop $SINGLEMDS || return 1
-        start $SINGLEMDS ${dev} $MDS_MOUNT_OPTS ||
-            { error "Failed to start $SINGLEMDS after stopping" && break; }
-        wait_osc_import_state mds ost FULL
-        clients_up
+       facet_failover $SINGLEMDS || error "failed to failover $SINGLEMDS"
+       wait_osc_import_state $SINGLEMDS ost FULL
+       clients_up
 
         wait_mds_ost_sync
         # Veriy that the pool got created and is usable
 
         wait_mds_ost_sync
         # Veriy that the pool got created and is usable
index 9641565..63d0b73 100755 (executable)
@@ -923,7 +923,7 @@ test_29a() { # bug 22273 - error adding new clients
        # fail abort so client will be new again
        fail_abort $SINGLEMDS
        client_up || error "reconnect failed"
        # fail abort so client will be new again
        fail_abort $SINGLEMDS
        client_up || error "reconnect failed"
-       wait_osc_import_state mds ost FULL
+       wait_osc_import_state $SINGLEMDS ost FULL
        return 0
 }
 run_test 29a "error adding new clients doesn't cause LBUG (bug 22273)"
        return 0
 }
 run_test 29a "error adding new clients doesn't cause LBUG (bug 22273)"
index 7d3dbed..6a02df4 100644 (file)
@@ -5121,7 +5121,7 @@ request_timeout () {
     echo $(( init_connect_timeout + at_min ))
 }
 
     echo $(( init_connect_timeout + at_min ))
 }
 
-wait_osc_import_state() {
+_wait_osc_import_state() {
     local facet=$1
     local ost_facet=$2
     local expected=$3
     local facet=$1
     local ost_facet=$2
     local expected=$3
@@ -5164,6 +5164,21 @@ wait_osc_import_state() {
        return 0
 }
 
        return 0
 }
 
+wait_osc_import_state() {
+       local facet=$1
+       local ost_facet=$2
+       local expected=$3
+       local num
+
+       if [[ $facet = mds ]]; then
+               for num in $(seq $MDSCOUNT); do
+                       _wait_osc_import_state mds$num "$ost_facet" "$expected"
+               done
+       else
+               _wait_osc_import_state "$facet" "$ost_facet" "$expected"
+       fi
+}
+
 get_clientmdc_proc_path() {
     echo "${1}-mdc-*"
 }
 get_clientmdc_proc_path() {
     echo "${1}-mdc-*"
 }