Whamcloud - gitweb
b=20918 t-f max recovery time estimation
[fs/lustre-release.git] / lustre / tests / test-framework.sh
index 772bcbf..81a4b7b 100644 (file)
@@ -34,15 +34,6 @@ if [ -f "$EXCEPT_LIST_FILE" ]; then
     . $EXCEPT_LIST_FILE
 fi
 
-if [[ -x $LUSTRE/utils/llobdstat ]]; then
-        LLOBDSTAT=$LUSTRE/utils/llobdstat
-elif [[ -x /usr/bin/llobdstat ]]; then
-        LLOBDSTAT=/usr/bin/llobdstat
-else
-        # Good luck
-        LLOBDSTAT=llobdstat
-fi
-
 [ -z "$MODPROBECONF" -a -f /etc/modprobe.conf ] && MODPROBECONF=/etc/modprobe.conf
 [ -z "$MODPROBECONF" -a -f /etc/modprobe.d/Lustre ] && MODPROBECONF=/etc/modprobe.d/Lustre
 
@@ -271,7 +262,7 @@ load_module() {
            (($# > 0)) && shift 2
 
             # Ensure we have accept=all for lnet
-            if [ $module = lnet ]; then
+            if [ $(basename $module) = lnet ]; then
                 # OK, this is a bit wordy...
                 local arg accept_all_present=false
                 for arg in "$@"; do
@@ -3581,6 +3572,24 @@ do_ls () {
     return $rc
 }
 
+# target_start_and_reset_recovery_timer()
+#        service_time = at_est2timeout(service_time);
+#        service_time += 2 * (CONNECTION_SWITCH_MAX + CONNECTION_SWITCH_INC +
+#                             INITIAL_CONNECT_TIMEOUT);
+# CONNECTION_SWITCH_MAX : min(25U, max(CONNECTION_SWITCH_MIN,obd_timeout))
+#define CONNECTION_SWITCH_INC 1
+#define INITIAL_CONNECT_TIMEOUT max(CONNECTION_SWITCH_MIN,obd_timeout/20)
+#define CONNECTION_SWITCH_MIN 5U
+
+max_recovery_time () {
+    local init_connect_timeout=$(( TIMEOUT / 20 ))
+    [[ $init_connect_timeout > 5 ]] || init_connect_timeout=5 
+
+    local service_time=$(( $(at_max_get client) + $(( 2 * $(( 25 + 1  + init_connect_timeout)) )) ))
+
+    echo $service_time 
+}
+
 get_clients_mount_count () {
     local clients=${CLIENTS:-`hostname`}
 
@@ -3602,7 +3611,7 @@ combination()
         R=0
     else
         N=$((N + 1))
-        while [ $N -le $M ]; do
+        while [ $N -lt $M ]; do
             R=$((R * N))
             N=$((N + 1))
         done
@@ -3813,6 +3822,7 @@ wait_flavor()
             return 0
         else
             echo "found $res $flavor connections of $dir, not ready ($expect)"
+            return 0
             sleep 4
         fi
     done