Whamcloud - gitweb
LU-8885 tests: zconf_mount_clients() defect
[fs/lustre-release.git] / lustre / tests / test-framework.sh
index a3a43f4..5727455 100755 (executable)
@@ -1776,14 +1776,24 @@ zconf_mount_clients() {
        fi
 
        do_nodes $clients "
-running=\\\$(mount | grep -c $mnt' ');
-rc=0;
-if [ \\\$running -eq 0 ] ; then
-    mkdir -p $mnt;
-    $MOUNT_CMD $flags $opts $device $mnt;
-    rc=\\\$?;
-fi;
-exit \\\$rc" || return ${PIPESTATUS[0]}
+               running=\\\$(mount | grep -c $mnt' ');
+               rc=0;
+               if [ \\\$running -eq 0 ] ; then
+                       mkdir -p $mnt;
+                       $MOUNT_CMD $flags $opts $device $mnt;
+                       rc=\\\$?;
+               else
+                       lustre_mnt_count=\\\$(mount | grep $mnt' ' | \
+                               grep 'type lustre' | wc -l);
+                       if [ \\\$running -ne \\\$lustre_mnt_count ] ; then
+                               echo zconf_mount_clients FAILED: \
+                                       mount count \\\$running, not matching \
+                                       with mount count of 'type lustre' \
+                                       \\\$lustre_mnt_count;
+                               rc=1;
+                       fi;
+               fi;
+       exit \\\$rc" || return ${PIPESTATUS[0]}
 
        echo "Started clients $clients: "
        do_nodes $clients "mount | grep $mnt' '"
@@ -2430,10 +2440,10 @@ wait_osts_up() {
        wait_update $HOSTNAME "eval $cmd" $OSTCOUNT ||
                error "wait_update OSTs up on client failed"
 
-       cmd="$LCTL get_param -n lod.$FSNAME-MDT*-*.target_obd | sort -u |
-            awk 'BEGIN {c = 0} /ACTIVE/{c += 1} END {printf \\\"%d\\\", c}'"
+       cmd="$LCTL get_param osp.$FSNAME-OST*-MDT0000.prealloc_last_id |
+            awk '/=[1-9][0-9]/ { c += 1 } END { printf \\\"%d\\\", c }'"
        wait_update_facet $SINGLEMDS "eval $cmd" $OSTCOUNT ||
-               error "wait_update OSTs up on MDT failed"
+               error "wait_update OSTs up on MDT0000 failed"
 }
 
 wait_destroy_complete () {
@@ -2771,7 +2781,7 @@ h2name_or_ip() {
 }
 
 h2nettype() {
-       if [[ -v NETTYPE ]]; then
+       if [[ -n "$NETTYPE" ]]; then
                h2name_or_ip "$1" "$NETTYPE"
        else
                h2name_or_ip "$1" "$2"
@@ -2782,7 +2792,7 @@ declare -fx h2nettype
 # Wrapper function to print the deprecation warning
 h2tcp() {
        echo "h2tcp: deprecated, use h2nettype instead" 1>&2
-       if [[ -v NETTYPE ]]; then
+       if [[ -n "$NETTYPE" ]]; then
                h2nettype "$@"
        else
                h2nettype "$1" "tcp"
@@ -2792,7 +2802,7 @@ h2tcp() {
 # Wrapper function to print the deprecation warning
 h2o2ib() {
        echo "h2o2ib: deprecated, use h2nettype instead" 1>&2
-       if [[ -v NETTYPE ]]; then
+       if [[ -n "$NETTYPE" ]]; then
                h2nettype "$@"
        else
                h2nettype "$1" "o2ib"
@@ -7137,7 +7147,7 @@ is_sanity_benchmark() {
 }
 
 min_ost_size () {
-    $LCTL get_param -n osc.*.kbytesavail | sort -n | head -n1
+       $LFS df | grep OST | awk '{print $4}' | sort -un | head -1
 }
 
 #