Whamcloud - gitweb
LU-17160 build: Use PyConfig_InitPythonConfig 3.11 and later
[fs/lustre-release.git] / lustre / tests / ha.sh
index 22ff1cc..987387b 100755 (executable)
@@ -519,7 +519,7 @@ ha_repeat_mpi_load()
                ha_on $client $LFS setstripe $stripeparams $dir &&
                ha_on $client $LFS getstripe $dir &&
                ha_on $client chmod a+xwr $dir &&
-               ha_on $client "su $mpiuser sh -c \" $mpirun $mpirunoptions \
+               ha_on $client "su $mpiuser bash -c \" $mpirun $mpirunoptions \
                        -np $((${#ha_clients[@]} * mpi_threads_per_client / ha_nclientsset)) \
                        $machines $cmd \" " || rc=$?
                ha_on ${ha_clients[0]} "$check_attrs &&                    \
@@ -527,9 +527,14 @@ ha_repeat_mpi_load()
                        $check_attrs " && rccheck=1
                [[ -n "$ha_postcmd" ]] && ha_info "$ha_postcmd" &&
                        ha_on $client "$ha_postcmd" >>"$log" 2>&1
-               (( ((rc == 0)) && ((rccheck == 0)) && (( mustpass != 0 )) )) ||
-               (( ((rc != 0)) && ((rccheck == 0)) && (( mustpass == 0 )) )) &&
-               ha_on $client rm -rf "$dir";
+               if (( ((rc == 0)) && ((rccheck == 0)) && \
+                       (( mustpass != 0 )) )) ||
+                       (( ((rc != 0)) && ((rccheck == 0)) && \
+                       (( mustpass == 0 )) )); then
+                       local suf=$(date +%s)
+                       $ha_cleanup && ha_on $client rm -rf "$dir" ||
+                               ha_on $client mv "$dir" "${dir}.${suf}"
+               fi;
                } >>"$log" 2>&1
 
                ha_info $client: rc=$rc rccheck=$rccheck mustpass=$mustpass
@@ -835,7 +840,7 @@ ha_lfsck_repaired()
 
        n=$(cat $ha_lfsck_log | awk '/repaired/ {print $3}' |\
                awk '{sum += $1} END { print sum }')
-       [ $n -eq 0] ||
+       (( n == 0 )) ||
                { ha_info "Total repaired: $n";
                ha_touch fail; return 1; }
        return 0