Whamcloud - gitweb
LU-246 Add a barrier for recovery completion for conf-sanity
[fs/lustre-release.git] / lustre / tests / conf-sanity.sh
index b487af2..11cf00f 100644 (file)
@@ -190,6 +190,7 @@ setup() {
        start_mds || error "MDT start failed"
        start_ost || error "OST start failed"
        mount_client $MOUNT || error "client start failed"
+       client_up || error "client_up failed"
 }
 
 setup_noconfig() {
@@ -722,6 +723,8 @@ test_21d() {
         stop_ost2
         stop_mds
         stop_mgs
+        #writeconf to remove all ost2 traces for subsequent tests
+        writeconf
 }
 run_test 21d "start mgs then ost and then mds"
 
@@ -1034,6 +1037,9 @@ test_29() {
            echo "Waiting $(($MAX - $WAIT)) secs for MDT deactivated"
        done
 
+        # quotacheck should not fail immediately after deactivate
+       [ -n "$ENABLE_QUOTA" ] && { $LFS quotacheck -ug $MOUNT || error "quotacheck has failed" ; }
+
         # test new client starts deactivated
        umount_client $MOUNT || return 200
        mount_client $MOUNT
@@ -1045,6 +1051,9 @@ test_29() {
            echo "New client success: got $RESULT"
        fi
 
+        # quotacheck should not fail after umount/mount operation
+       [ -n "$ENABLE_QUOTA" ] && { $LFS quotacheck -ug $MOUNT || error "quotacheck has failed" ; }
+
        # make sure it reactivates
        set_and_check client "lctl get_param -n $PROC_ACT" "$PARAM" $ACTV || return 6
 
@@ -1701,7 +1710,7 @@ run_test 39 "leak_finder recognizes both LUSTRE and LNET malloc messages"
 test_40() { # bug 15759
        start_ost
        #define OBD_FAIL_TGT_TOOMANY_THREADS     0x706
-       do_facet $SINGLEMDS "sysctl -w lustre.fail_loc=0x80000706"
+       do_facet $SINGLEMDS "$LCTL set_param fail_loc=0x80000706"
        start_mds
        cleanup
 }
@@ -2164,6 +2173,8 @@ test_50c() {
        umount_client $MOUNT || error "Unable to unmount client"
        stop_ost2 || error "Unable to stop OST2"
        stop_mds || error "Unable to stop MDS"
+       #writeconf to remove all ost2 traces for subsequent tests
+       writeconf
 }
 run_test 50c "lazystatfs one server down =========================="
 
@@ -2184,6 +2195,8 @@ test_50d() {
        umount_client $MOUNT || error "Unable to unmount client"
        stop_ost2 || error "Unable to stop OST2"
        stop_mds || error "Unable to stop MDS"
+       #writeconf to remove all ost2 traces for subsequent tests
+       writeconf
 }
 run_test 50d "lazystatfs client/server conn race =========================="
 
@@ -2315,6 +2328,8 @@ test_51() {
        wait $pid
        stop_ost2 || return 3
        cleanup
+       #writeconf to remove all ost2 traces for subsequent tests
+       writeconf
 }
 run_test 51 "Verify that mdt_reint handles RMF_MDT_MD correctly when an OST is added"
 
@@ -2491,21 +2506,22 @@ thread_sanity() {
         lassert 23 "$msg (PDSH problems?)" '(($tstarted && $tmin && $tmax))' || return $?
         lassert 24 "$msg" '(($tstarted >= $tmin && $tstarted <= $tmax ))' || return $?
 
-        # Check that we can lower min/max
-        do_facet $facet "lctl set_param ${paramp}.threads_min=$((tmin - 1))"
+        # Check that we can change min/max
+        do_facet $facet "lctl set_param ${paramp}.threads_min=$((tmin + 1))"
         do_facet $facet "lctl set_param ${paramp}.threads_max=$((tmax - 1))"
         tmin2=$(do_facet $facet "lctl get_param -n ${paramp}.threads_min" || echo 0)
         tmax2=$(do_facet $facet "lctl get_param -n ${paramp}.threads_max" || echo 0)
-        lassert 25 "$msg" '(($tmin2 == ($tmin - 1) && $tmax2 == ($tmax -1)))' || return $?
+        lassert 25 "$msg" '(($tmin2 == ($tmin + 1) && $tmax2 == ($tmax -1)))' || return $?
 
         # Check that we can set min/max to the same value
-        do_facet $facet "lctl set_param ${paramp}.threads_max=$((tmin - 1))"
+        tmin=$(do_facet $facet "lctl get_param -n ${paramp}.threads_min" || echo 0)
+        do_facet $facet "lctl set_param ${paramp}.threads_max=$tmin"
         tmin2=$(do_facet $facet "lctl get_param -n ${paramp}.threads_min" || echo 0)
         tmax2=$(do_facet $facet "lctl get_param -n ${paramp}.threads_max" || echo 0)
-        lassert 26 "$msg" '(($tmin2 == ($tmin - 1) && $tmax2 == ($tmin - 1)))' || return $?
+        lassert 26 "$msg" '(($tmin2 == $tmin && $tmax2 == $tmin))' || return $?
 
         # Check that we can't set max < min
-        do_facet $facet "lctl set_param ${paramp}.threads_max=$((tmin - 2))"
+        do_facet $facet "lctl set_param ${paramp}.threads_max=$((tmin - 1))"
         tmin2=$(do_facet $facet "lctl get_param -n ${paramp}.threads_min" || echo 0)
         tmax2=$(do_facet $facet "lctl get_param -n ${paramp}.threads_max" || echo 0)
         lassert 27 "$msg" '(($tmin2 <= $tmax2))' || return $?
@@ -2630,21 +2646,52 @@ test_56() {
 }
 run_test 56 "check big indexes"
 
-test_57() { # bug 22656
+test_57a() { # bug 22656
        local NID=$(do_facet ost1 "$LCTL get_param nis" | tail -1 | awk '{print $1}')
        writeconf
        do_facet ost1 "$TUNEFS --failnode=$NID `ostdevname 1`" || error "tunefs failed"
        start_mgsmds
        start_ost && error "OST registration from failnode should fail"
-       stop_mds
        reformat
 }
-run_test 57 "initial registration from failnode should fail (should return errs)"
+run_test 57a "initial registration from failnode should fail (should return errs)"
+
+test_57b() {
+       local NID=$(do_facet ost1 "$LCTL get_param nis" | tail -1 | awk '{print $1}')
+       writeconf
+       do_facet ost1 "$TUNEFS --servicenode=$NID `ostdevname 1`" || error "tunefs failed"
+       start_mgsmds
+       start_ost || error "OST registration from servicenode should not fail"
+       reformat
+}
+run_test 57b "initial registration from servicenode should not fail"
 
 count_osts() {
         do_facet mgs $LCTL get_param mgs.MGS.live.$FSNAME | grep OST | wc -l
 }
 
+test_58() { # bug 22658
+        [ "$FSTYPE" != "ldiskfs" ] && skip "not supported for $FSTYPE" && return
+       setup
+       mkdir -p $DIR/$tdir
+       createmany -o $DIR/$tdir/$tfile-%d 100
+       # make sure that OSTs do not cancel llog cookies before we unmount the MDS
+#define OBD_FAIL_OBD_LOG_CANCEL_NET      0x601
+       do_facet mds "lctl set_param fail_loc=0x601"
+       unlinkmany $DIR/$tdir/$tfile-%d 100
+       stop mds
+       local MNTDIR=$(facet_mntpt mds)
+       # remove all files from the OBJECTS dir
+       do_facet mds "mount -t ldiskfs $MDSDEV $MNTDIR"
+       do_facet mds "find $MNTDIR/OBJECTS -type f -delete"
+       do_facet mds "umount $MNTDIR"
+       # restart MDS with missing llog files
+       start_mds
+       do_facet mds "lctl set_param fail_loc=0"
+       reformat
+}
+run_test 58 "missing llog files must not prevent MDT from mounting"
+
 test_59() {
        start_mgsmds >> /dev/null
        local C1=$(count_osts)
@@ -2672,32 +2719,11 @@ test_59() {
        [ $C4 -eq 2 ] || error "OST2 writeconf should add log"
        stop_ost2 >> /dev/null
        cleanup_nocli >> /dev/null
+       #writeconf to remove all ost2 traces for subsequent tests
+       writeconf
 }
 run_test 59 "writeconf mount option"
 
-
-test_58() { # bug 22658
-        [ "$FSTYPE" != "ldiskfs" ] && skip "not supported for $FSTYPE" && return
-       setup
-       mkdir -p $DIR/$tdir
-       createmany -o $DIR/$tdir/$tfile-%d 100
-       # make sure that OSTs do not cancel llog cookies before we unmount the MDS
-#define OBD_FAIL_OBD_LOG_CANCEL_NET      0x601
-       do_facet mds "lctl set_param fail_loc=0x601"
-       unlinkmany $DIR/$tdir/$tfile-%d 100
-       stop mds
-       local MNTDIR=$(facet_mntpt mds)
-       # remove all files from the OBJECTS dir
-       do_facet mds "mount -t ldiskfs $MDSDEV $MNTDIR"
-       do_facet mds "find $MNTDIR/OBJECTS -type f -delete"
-       do_facet mds "umount $MNTDIR"
-       # restart MDS with missing llog files
-       start_mds
-       do_facet mds "lctl set_param fail_loc=0"
-       reformat
-}
-run_test 58 "missing llog files must not prevent MDT from mounting"
-
 if ! combined_mgs_mds ; then
        stop mgs
 fi