Whamcloud - gitweb
b=22225 Remove += and refactor equals_msg
authorRobert Read <rread@sun.com>
Thu, 18 Mar 2010 23:05:59 +0000 (16:05 -0700)
committerRobert Read <rread@sun.com>
Fri, 2 Apr 2010 18:01:26 +0000 (11:01 -0700)
lustre/tests/test-framework.sh

index 4893f7f..772bcbf 100644 (file)
@@ -2616,13 +2616,8 @@ run_test() {
     return $?
 }
 
     return $?
 }
 
-EQUALS="======================================================================"
 equals_msg() {
 equals_msg() {
-    msg="$@"
-
-    local suffixlen=$((${#EQUALS} - ${#msg}))
-    [ $suffixlen -lt 5 ] && suffixlen=5
-    log `echo $(printf '===== %s %.*s\n' "$msg" $suffixlen $EQUALS)`
+    banner "$*"
 }
 
 log() {
 }
 
 log() {
@@ -2677,18 +2672,15 @@ reset_fail_loc () {
 # Log a message (on all nodes) padded with "=" before and after. 
 # Also appends a timestamp and prepends the testsuite name.
 # 
 # Log a message (on all nodes) padded with "=" before and after. 
 # Also appends a timestamp and prepends the testsuite name.
 # 
+
+EQUALS="===================================================================================================="
 banner() {
     msg="== ${TESTSUITE} $*"
 banner() {
     msg="== ${TESTSUITE} $*"
-    # pad the message out to 70 with "="
     last=${msg: -1:1}
     last=${msg: -1:1}
-    [[ $last != "=" && $last != " " ]] && msg+=" "
-    for i in $(seq $((68 - ${#msg})) ); do
-       msg+="="
-    done
+    [[ $last != "=" && $last != " " ]] && msg="$msg "
+    msg=$(printf '%s%.*s'  "$msg"  $((${#EQUALS} - ${#msg})) $EQUALS )
     # always include at least == after the message
     # always include at least == after the message
-    msg+="=="
-
-    log "$msg $(date +"%H:%M:%S (%s)")"
+    log "$msg== $(date +"%H:%M:%S (%s)")"
 }
 
 #
 }
 
 #