Whamcloud - gitweb
Revert "LU-5810 tests: add client hostname to lctl mark" 94/20894/3
authorJames Nunez <james.a.nunez@intel.com>
Tue, 21 Jun 2016 14:56:18 +0000 (14:56 +0000)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 22 Jun 2016 21:20:25 +0000 (21:20 +0000)
Adding hostname to individual lines in test logs broke autotest's
parsing of logs and resulted in no console logs being uploaded to
Maloo. In addition, the way that we added hostname to the log
output was nosier than expect and needs to be reworked.

This reverts commit 9c4156e6fc146a198bb342e28eb246f1076889bd.

Change-Id: I6d7c38fd37edc975bc4f5e1ff5c825d4899af474
Signed-off-by: James Nunez <james.a.nunez@intel.com>
Reviewed-on: http://review.whamcloud.com/20894
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Tested-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/lockorder.sh
lustre/tests/recovery-small.sh
lustre/tests/replay-single-lmv.sh
lustre/tests/replay-single.sh
lustre/tests/sanity.sh
lustre/tests/sanityn.sh
lustre/tests/test-framework.sh

index c21498d..122df46 100644 (file)
@@ -56,7 +56,7 @@ mv $MAXDIR $LOCKDIR
 mv $MINFILE $LOCKFILE
 rm -rf $DIR/d$$
 
-$LCTL mark "$HOSTNAME: start dir: $LOCKDIR=$MAXRES file: $LOCKFILE=$MINRES"
+$LCTL mark "start dir: $LOCKDIR=$MAXRES file: $LOCKFILE=$MINRES"
 # link will lock $LOCKFILE and $DIR as it creates ${LOCKFILE}{0,1,...}
 $CREATEMANY -l$LOCKFILE $LOCKFILE -$COUNT &
 CR_PID=$!
index 1089c6d..5d6a40d 100755 (executable)
@@ -308,7 +308,7 @@ run_test 11 "wake up a thread waiting for completion after eviction (b=2460)"
 
 #b=2494
 test_12(){
-       $LCTL mark "$HOSTNAME: $MULTIOP $DIR/$tfile OS_c"
+       $LCTL mark $MULTIOP $DIR/$tfile OS_c
        do_facet $SINGLEMDS "lctl set_param fail_loc=0x115"
        clear_failloc $SINGLEMDS $((TIMEOUT * 2)) &
        multiop_bg_pause $DIR/$tfile OS_c ||
index db137fe..21dd7ca 100755 (executable)
@@ -94,22 +94,22 @@ test_2a() {
 run_test 2a "unlink cross-node file (fail mds with name)"
 
 test_3a() {
-       replay_barrier mds2
-       mkdir $DIR/dir3a1
-       $LCTL mark "$HOSTNAME FAILOVER mds2"
-       fail mds2
-       stat $DIR
-       $CHECKSTAT -t dir $DIR/dir3a1 || return 1
+    replay_barrier mds2
+    mkdir $DIR/dir3a1
+    $LCTL mark "FAILOVER mds2"
+    fail mds2
+    stat $DIR
+    $CHECKSTAT -t dir $DIR/dir3a1 || return 1
 }
 run_test 3a "mkdir cross-node dir (fail mds with inode)"
 
 test_3b() {
-       replay_barrier mds1
-       mkdir $DIR/dir3b1
-       $LCTL mark "$HOSTNAME FAILOVER mds1"
-       fail mds1
-       stat $DIR
-       $CHECKSTAT -t dir $DIR/dir3b1 || return 1
+    replay_barrier mds1
+    mkdir $DIR/dir3b1
+    $LCTL mark "FAILOVER mds1"
+    fail mds1
+    stat $DIR
+    $CHECKSTAT -t dir $DIR/dir3b1 || return 1
 }
 run_test 3b "mkdir cross-node dir (fail mds with inode)"
 
index 7e316ff..8bf86a9 100755 (executable)
@@ -873,7 +873,7 @@ test_40(){
        lctl get_param mdc.*.connect_flags | grep -q layout_lock &&
                skip "layout_lock needs MDS connection for IO" && return 0
 
-       $LCTL mark "$HOSTNAME multiop $MOUNT/$tfile OS_c"
+       $LCTL mark multiop $MOUNT/$tfile OS_c
        multiop $MOUNT/$tfile OS_c  &
        PID=$!
        writeme -s $MOUNT/${tfile}-2 &
index 87d9bad..53d33b5 100644 (file)
@@ -5304,14 +5304,14 @@ test_60d() {
 
        # verify "lctl mark" is even working"
        MESSAGE="test message ID $RANDOM $$"
-       $LCTL mark "$HOSTNAME $MESSAGE" || error "$LCTL mark failed"
+       $LCTL mark "$MESSAGE" || error "$LCTL mark failed"
        dmesg | grep -q "$MESSAGE" || error "didn't find debug marker in log"
 
        lctl set_param printk=0 || error "set lnet.printk failed"
        lctl get_param -n printk | grep emerg || error "lnet.printk dropped emerg"
        MESSAGE="new test message ID $RANDOM $$"
        # Assume here that libcfs_debug_mark_buffer() uses D_WARNING
-       $LCTL mark "$HOSTNAME $MESSAGE" || error "$LCTL mark failed"
+       $LCTL mark "$MESSAGE" || error "$LCTL mark failed"
        dmesg | grep -q "$MESSAGE" && error "D_WARNING wasn't masked" || true
 
        lctl set_param -n printk="$SAVEPRINTK"
index 2b65a30..fc9a971 100755 (executable)
@@ -1219,7 +1219,7 @@ test_36() { #bug 16417
        sync; sleep 5; sync # wait for delete thread
 
        while [ $i -le 10 ]; do
-               lctl mark "$HOSTNAME start test loop $i"
+               lctl mark "start test"
                local before=$(lfs_df $MOUNT1 | awk '/^filesystem/{ print $4; exit }')
                dd if=/dev/zero of=$DIR1/$tdir/$tfile bs=1M count=$SIZE ||
                        error "dd $DIR1/$tdir/$tfile ${SIZE}MB failed"
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() {