Whamcloud - gitweb
LU-296 Add missing code from auster/yaml port to b1_8
authorYu Jian <yujian@whamcloud.com>
Fri, 13 May 2011 04:50:54 +0000 (12:50 +0800)
committerJohann Lombardi <johann@whamcloud.com>
Fri, 13 May 2011 06:27:36 +0000 (23:27 -0700)
Code related to defining and creating the $TF_FAIL file was missed in
the port of auster and yaml to b1_8. This patch adds the missing
code. Namely:

- Define TF_FAIL in acceptance-small.sh
- add 'touch $TF_FAIL' to the test-framework.sh ERR signal trap

Additionally, the file test for $TF_FAIL variable should be quoted in
acceptance-small.sh and auster.sh. Otherwise, if this variable is not
defined, bash will spit out something like

acceptance-small.sh: line 123: [: too many arguments

Bash variables should generally be quoted whenever they are referenced.
(see http://tldp.org/LDP/abs/html/quotingvar.html).

Signed-off-by: Chris Horn <hornc@cray.com>
Signed-off-by: Yu Jian <yujian@whamcloud.com>
Change-Id: I2071c859d00b8cd8bd423bf9f626b44352456191
Reviewed-on: http://review.whamcloud.com/516
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Tested-by: Hudson
lustre/tests/acceptance-small.sh
lustre/tests/auster.sh
lustre/tests/test-framework.sh

index 83a9532..efed401 100755 (executable)
@@ -20,6 +20,8 @@ if [[ -n $@ ]]; then
     ACC_SM_ONLY="${ACC_SM_ONLY} $@"
 fi
 
+export TF_FAIL=$TMP/tf.fail
+
 if [ "$ACC_SM_ONLY" ]; then
     for O in $DEFAULT_SUITES; do
         O=$(echo $O | tr "-" "_" | tr "[:lower:]" "[:upper:]")
@@ -120,7 +122,7 @@ run_suite() {
         bash $suite_script ${!suite_only}
         rc=$?
         duration=$(($(date +%s) - $start_ts))
-        if [ -f $TF_FAIL -o $rc -ne 0 ]; then
+        if [ -f "$TF_FAIL" -o $rc -ne 0 ]; then
             status="FAIL"
         else
             status="PASS"
index 17c60e1..39f5c62 100755 (executable)
@@ -189,7 +189,7 @@ run_suite() {
     doit bash $suite_script
     rc=$?
     duration=$(($(date +%s) - $start_ts))
-    if [ -f $TF_FAIL -o $rc -ne 0 ]; then
+    if [ -f "$TF_FAIL" -o $rc -ne 0 ]; then
         status="FAIL"
     else
         status="PASS"
index 9181fb2..feaff4e 100644 (file)
@@ -1,7 +1,8 @@
 #!/bin/bash
 # vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4:
 
-trap 'print_summary && echo "test-framework exiting on error"' ERR
+trap 'print_summary && touch $TF_FAIL && \
+    echo "test-framework exiting on error"' ERR
 set -e
 #set -x