Whamcloud - gitweb
Revert "LU-5810 tests: add client hostname to lctl mark"
[fs/lustre-release.git] / lustre / tests / test-framework.sh
index a0a4f66..427683d 100755 (executable)
@@ -2555,8 +2555,8 @@ replay_barrier() {
        # inside fail() and fail_abort().
        #
        do_facet $facet $LCTL --device ${!svc} readonly
-       do_facet $facet $LCTL mark "$HOSTNAME: $facet REPLAY BARRIER on ${!svc}"
-       $LCTL mark "$HOSTNAME: local REPLAY BARRIER on ${!svc}"
+       do_facet $facet $LCTL mark "$facet REPLAY BARRIER on ${!svc}"
+       $LCTL mark "local REPLAY BARRIER on ${!svc}"
 }
 
 replay_barrier_nodf() {
@@ -2566,8 +2566,8 @@ replay_barrier_nodf() {
        echo Replay barrier on ${!svc}
        do_facet $facet $LCTL --device ${!svc} notransno
        do_facet $facet $LCTL --device ${!svc} readonly
-       do_facet $facet $LCTL mark "$HOSTNAME: $facet REPLAY BARRIER on ${!svc}"
-       $LCTL mark "$HOSTNAME: local REPLAY BARRIER on ${!svc}"
+       do_facet $facet $LCTL mark "$facet REPLAY BARRIER on ${!svc}"
+       $LCTL mark "local REPLAY BARRIER on ${!svc}"
 }
 
 replay_barrier_nosync() {
@@ -2576,8 +2576,8 @@ replay_barrier_nosync() {
        echo Replay barrier on ${!svc}
        do_facet $facet $LCTL --device ${!svc} notransno
        do_facet $facet $LCTL --device ${!svc} readonly
-       do_facet $facet $LCTL mark "$HOSTNAME: $facet REPLAY BARRIER on ${!svc}"
-       $LCTL mark "$HOSTNAME: local REPLAY BARRIER on ${!svc}"
+       do_facet $facet $LCTL mark "$facet REPLAY BARRIER on ${!svc}"
+       $LCTL mark "local REPLAY BARRIER on ${!svc}"
 }
 
 #
@@ -2892,26 +2892,26 @@ change_active() {
 }
 
 do_node() {
-       local verbose=false
-       # do not stripe off hostname if verbose, bug 19215
-       if [ x$1 = x--verbose ]; then
-               shift
-               verbose=true
-       fi
+    local verbose=false
+    # do not stripe off hostname if verbose, bug 19215
+    if [ x$1 = x--verbose ]; then
+        shift
+        verbose=true
+    fi
 
-       local HOST=$1
-       shift
-       local myPDSH=$PDSH
-       if [ "$HOST" = "$HOSTNAME" ]; then
-               myPDSH="no_dsh"
-       elif [ -z "$myPDSH" -o "$myPDSH" = "no_dsh" ]; then
-               echo "cannot run remote command on $HOST with $myPDSH"
-               return 128
-       fi
-       if $VERBOSE; then
-               echo "CMD: $HOST $@" >&2
-               $myPDSH $HOST "$LCTL mark \"$HOSTNAME: $@\"" &>/dev/null || :
-       fi
+    local HOST=$1
+    shift
+    local myPDSH=$PDSH
+    if [ "$HOST" = "$HOSTNAME" ]; then
+        myPDSH="no_dsh"
+    elif [ -z "$myPDSH" -o "$myPDSH" = "no_dsh" ]; then
+        echo "cannot run remote command on $HOST with $myPDSH"
+        return 128
+    fi
+    if $VERBOSE; then
+        echo "CMD: $HOST $@" >&2
+        $myPDSH $HOST "$LCTL mark \"$@\"" > /dev/null 2>&1 || :
+    fi
 
     if [ "$myPDSH" = "rsh" ]; then
 # we need this because rsh does not return exit code of an executed command
@@ -3007,18 +3007,17 @@ do_nodes() {
         return $?
     fi
 
-       # This is part from do_node
-       local myPDSH=$PDSH
+    # This is part from do_node
+    local myPDSH=$PDSH
 
-       [ -z "$myPDSH" -o "$myPDSH" = "no_dsh" -o "$myPDSH" = "rsh" ] &&
-               echo "cannot run remote command on $rnodes with $myPDSH" &&
-               return 128
+    [ -z "$myPDSH" -o "$myPDSH" = "no_dsh" -o "$myPDSH" = "rsh" ] && \
+        echo "cannot run remote command on $rnodes with $myPDSH" && return 128
 
-       export FANOUT=$(get_node_count "${rnodes//,/ }")
-       if $VERBOSE; then
-               echo "CMD: $rnodes $@" >&2
-               $myPDSH $rnodes "$LCTL mark \"$HOSTNAME: $@\"" &>/dev/null || :
-       fi
+    export FANOUT=$(get_node_count "${rnodes//,/ }")
+    if $VERBOSE; then
+        echo "CMD: $rnodes $@" >&2
+        $myPDSH $rnodes "$LCTL mark \"$@\"" > /dev/null 2>&1 || :
+    fi
 
     # do not replace anything from pdsh output if -N is used
     # -N     Disable hostname: prefix on lines of output.
@@ -4641,10 +4640,10 @@ set_nodes_failloc () {
 }
 
 cancel_lru_locks() {
-       #$LCTL mark "$HOSTNAME: cancel_lru_locks $1 start"
+       #$LCTL mark "cancel_lru_locks $1 start"
        $LCTL set_param -n ldlm.namespaces.*$1*.lru_size=clear
        $LCTL get_param ldlm.namespaces.*$1*.lock_unused_count | grep -v '=0'
-       #$LCTL mark "$HOSTNAME: cancel_lru_locks $1 stop"
+       #$LCTL mark "cancel_lru_locks $1 stop"
 }
 
 default_lru_size()
@@ -4942,18 +4941,17 @@ log() {
        echo "$*" >&2
        load_module ../libcfs/libcfs/libcfs
 
-       local MSG="$HOSTNAME: $*"
-       # Get rid of '
-       MSG=${MSG//\'/\\\'}
-       MSG=${MSG//\(/\\\(}
-       MSG=${MSG//\)/\\\)}
-       MSG=${MSG//\;/\\\;}
-       MSG=${MSG//\|/\\\|}
-       MSG=${MSG//\>/\\\>}
-       MSG=${MSG//\</\\\<}
-       MSG=${MSG//\//\\\/}
-       do_nodes $(comma_list $(nodes_list)) $LCTL mark "$MSG" 2> /dev/null ||
-               true
+    local MSG="$*"
+    # Get rid of '
+    MSG=${MSG//\'/\\\'}
+    MSG=${MSG//\(/\\\(}
+    MSG=${MSG//\)/\\\)}
+    MSG=${MSG//\;/\\\;}
+    MSG=${MSG//\|/\\\|}
+    MSG=${MSG//\>/\\\>}
+    MSG=${MSG//\</\\\<}
+    MSG=${MSG//\//\\\/}
+    do_nodes $(comma_list $(nodes_list)) $LCTL mark "$MSG" 2> /dev/null || true
 }
 
 trace() {