From 6f2c9a8ec8d4ef13d3b5b28ba514798587711986 Mon Sep 17 00:00:00 2001 From: Yu Jian Date: Fri, 13 May 2011 12:50:54 +0800 Subject: [PATCH] LU-296 Add missing code from auster/yaml port to b1_8 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 Signed-off-by: Yu Jian Change-Id: I2071c859d00b8cd8bd423bf9f626b44352456191 Reviewed-on: http://review.whamcloud.com/516 Reviewed-by: Johann Lombardi Tested-by: Hudson --- lustre/tests/acceptance-small.sh | 4 +++- lustre/tests/auster.sh | 2 +- lustre/tests/test-framework.sh | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lustre/tests/acceptance-small.sh b/lustre/tests/acceptance-small.sh index 83a9532..efed401 100755 --- a/lustre/tests/acceptance-small.sh +++ b/lustre/tests/acceptance-small.sh @@ -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" diff --git a/lustre/tests/auster.sh b/lustre/tests/auster.sh index 17c60e1..39f5c62 100755 --- a/lustre/tests/auster.sh +++ b/lustre/tests/auster.sh @@ -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" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 9181fb2..feaff4e 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -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 -- 1.8.3.1