aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShaoyong Wang <shaoyongx.wang@intel.com>2013-02-28 10:14:04 -0500
committerChen Gong <gong.chen@linux.intel.com>2013-04-01 03:29:06 -0400
commit8e986d9bd4df76f2a7c27a8ccdb5b19689418fb6 (patch)
tree96eb31d5c4b3c8b6e8f9f185081f02cd4db0910c
parentd55cc9437f85a6a5287f167866a37f589c08c5ea (diff)
downloadmce-test-8e986d9bd4df76f2a7c27a8ccdb5b19689418fb6.tar.gz
check TMP_DIR path for all runtest.sh scripts
To avoid temporary files are saved in wrong directory when test script is executed under its own directory, TMP_DIR path should be identified before the test. Signed-off-by: Shaoyong Wang <shaoyongx.wang@intel.com> Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
-rwxr-xr-xcases/function/apei-inj/runtest.sh6
-rwxr-xr-xcases/function/bsp/runtest.sh7
-rwxr-xr-xcases/function/core_recovery/runtest_dcu.sh7
-rwxr-xr-xcases/function/core_recovery/runtest_ifu.sh7
-rwxr-xr-xcases/function/einj-ext/runtest.sh6
-rwxr-xr-xcases/function/erst-inject/runtest.sh7
-rw-r--r--cases/function/hwpoison/helpers.sh7
-rwxr-xr-xcases/function/pfa/runtest.sh7
-rwxr-xr-xcases/stress/hwpoison/run_hard.sh7
-rwxr-xr-xcases/stress/hwpoison/run_soft.sh7
10 files changed, 66 insertions, 2 deletions
diff --git a/cases/function/apei-inj/runtest.sh b/cases/function/apei-inj/runtest.sh
index b9d5533..11099a0 100755
--- a/cases/function/apei-inj/runtest.sh
+++ b/cases/function/apei-inj/runtest.sh
@@ -19,7 +19,11 @@ injected to test the availiability of APEI/EINJ.
EOF
TMP="../../../work"
-export TMP_DIR=${TMP_DIR:-$TMP}
+TMP_DIR=${TMP_DIR:-$TMP}
+if [ ! -d $TMP_DIR ]; then
+ TMP_DIR=$TMP
+fi
+export TMP_DIR
echo 0 > $TMP_DIR/error.$$
diff --git a/cases/function/bsp/runtest.sh b/cases/function/bsp/runtest.sh
index 7640056..9940711 100755
--- a/cases/function/bsp/runtest.sh
+++ b/cases/function/bsp/runtest.sh
@@ -40,6 +40,13 @@ export ROOT=`pwd`
. $ROOT/lib/functions.sh
+TMP="../../../work"
+TMP_DIR=${TMP_DIR:-$TMP}
+if [ ! -d $TMP_DIR ]; then
+ TMP_DIR=$TMP
+fi
+export TMP_DIR
+
export NUM_CPU=`ls -d /sys/devices/system/cpu/cpu[0-9]* | wc -l`
export MAX_CPU=`expr $NUM_CPU - 1`
export BSP_LOG_DIR=$ROOT/cases/function/bsp/log
diff --git a/cases/function/core_recovery/runtest_dcu.sh b/cases/function/core_recovery/runtest_dcu.sh
index 69b653d..8a728c3 100755
--- a/cases/function/core_recovery/runtest_dcu.sh
+++ b/cases/function/core_recovery/runtest_dcu.sh
@@ -16,6 +16,13 @@ please test again after rebooot or just skip this test.
EOF
+TMP="../../../work"
+TMP_DIR=${TMP_DIR:-$TMP}
+if [ ! -d $TMP_DIR ]; then
+ TMP_DIR=$TMP
+fi
+export TMP_DIR
+
echo 0 > $TMP_DIR/error.$$
pushd `dirname $0` > /dev/null
diff --git a/cases/function/core_recovery/runtest_ifu.sh b/cases/function/core_recovery/runtest_ifu.sh
index ab53b6c..1f952c2 100755
--- a/cases/function/core_recovery/runtest_ifu.sh
+++ b/cases/function/core_recovery/runtest_ifu.sh
@@ -16,6 +16,13 @@ please test again after rebooot or just skip this test.
EOF
+TMP="../../../work"
+TMP_DIR=${TMP_DIR:-$TMP}
+if [ ! -d $TMP_DIR ]; then
+ TMP_DIR=$TMP
+fi
+export TMP_DIR
+
echo 0 > $TMP_DIR/error.$$
pushd `dirname $0` > /dev/null
diff --git a/cases/function/einj-ext/runtest.sh b/cases/function/einj-ext/runtest.sh
index c9b0bec..c1652c9 100755
--- a/cases/function/einj-ext/runtest.sh
+++ b/cases/function/einj-ext/runtest.sh
@@ -13,7 +13,11 @@ Injection test with ACPI5.0 enabled BIOS.
EOF
TMP="../../../work"
-export TMP_DIR=${TMP_DIR:-$TMP}
+TMP_DIR=${TMP_DIR:-$TMP}
+if [ ! -d $TMP_DIR ]; then
+ TMP_DIR=$TMP
+fi
+export TMP_DIR
echo 0 > $TMP_DIR/error.$$
diff --git a/cases/function/erst-inject/runtest.sh b/cases/function/erst-inject/runtest.sh
index 253ebe3..aa81bcf 100755
--- a/cases/function/erst-inject/runtest.sh
+++ b/cases/function/erst-inject/runtest.sh
@@ -60,6 +60,13 @@ restore the valid data in the ERST to the other safe place.
EOF
+TMP="../../../work"
+TMP_DIR=${TMP_DIR:-$TMP}
+if [ ! -d $TMP_DIR ]; then
+ TMP_DIR=$TMP
+fi
+export TMP_DIR
+
ERST=./erst-inject
LOG=$TMP_DIR/erst.log.$$
MODSTATUS=0
diff --git a/cases/function/hwpoison/helpers.sh b/cases/function/hwpoison/helpers.sh
index 7b241c8..b9ddcbe 100644
--- a/cases/function/hwpoison/helpers.sh
+++ b/cases/function/hwpoison/helpers.sh
@@ -4,6 +4,13 @@ export ROOT=`(cd ../../../; pwd)`
. $ROOT/lib/functions.sh
setup_path
+TMP="../../../work"
+TMP_DIR=${TMP_DIR:-$TMP}
+if [ ! -d $TMP_DIR ]; then
+TMP_DIR=$TMP
+fi
+export TMP_DIR
+
executed_testcase=0
failed_testcase=0
diff --git a/cases/function/pfa/runtest.sh b/cases/function/pfa/runtest.sh
index 7428e25..8213e58 100755
--- a/cases/function/pfa/runtest.sh
+++ b/cases/function/pfa/runtest.sh
@@ -17,6 +17,13 @@ one can run *load.sh" by hand before the formal test!
EOF
+TMP="../../../work"
+TMP_DIR=${TMP_DIR:-$TMP}
+if [ ! -d $TMP_DIR ]; then
+ TMP_DIR=$TMP
+fi
+export TMP_DIR
+
echo 0 > $TMP_DIR/error.$$
pushd `dirname $0` > /dev/null
diff --git a/cases/stress/hwpoison/run_hard.sh b/cases/stress/hwpoison/run_hard.sh
index 163f217..3e1f67e 100755
--- a/cases/stress/hwpoison/run_hard.sh
+++ b/cases/stress/hwpoison/run_hard.sh
@@ -34,6 +34,13 @@ whether or not it is a real error.
EOF
+TMP="../../../work"
+TMP_DIR=${TMP_DIR:-$TMP}
+if [ ! -d $TMP_DIR ]; then
+ TMP_DIR=$TMP
+fi
+export TMP_DIR
+
echo 0 > $TMP_DIR/error.$$
pushd `dirname $0` > /dev/null
diff --git a/cases/stress/hwpoison/run_soft.sh b/cases/stress/hwpoison/run_soft.sh
index 8e86be1..d316854 100755
--- a/cases/stress/hwpoison/run_soft.sh
+++ b/cases/stress/hwpoison/run_soft.sh
@@ -33,6 +33,13 @@ whether or not it is a real error.
EOF
+TMP="../../../work"
+TMP_DIR=${TMP_DIR:-$TMP}
+if [ ! -d $TMP_DIR ]; then
+ TMP_DIR=$TMP
+fi
+export TMP_DIR
+
echo 0 > $TMP_DIR/error.$$
pushd `dirname $0` > /dev/null