aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShaoyong Wang <shaoyongx.wang@intel.com>2013-04-02 07:51:04 -0400
committerChen Gong <gong.chen@linux.intel.com>2013-04-01 03:29:11 -0400
commit470aa9cfcee3b5efd60c054302ca57a064fc66f1 (patch)
tree01abf1ac40745f0022d8893bed298109e0781c11
parent8e986d9bd4df76f2a7c27a8ccdb5b19689418fb6 (diff)
downloadmce-test-470aa9cfcee3b5efd60c054302ca57a064fc66f1.tar.gz
Update the test script for BSP test case
1. Don't use $ROOT to locate BSP directory, $TMP_DIR instead 2. Change the invoke sequence of variables (NUM_FAIL_CPU/NUM_PASS_CPU) to avoid any complaint. Signed-off-by: Shaoyong Wang <shaoyongx.wang@intel.com> Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
-rwxr-xr-xcases/function/bsp/bsp-test.sh4
-rwxr-xr-xcases/function/bsp/runtest.sh20
2 files changed, 13 insertions, 11 deletions
diff --git a/cases/function/bsp/bsp-test.sh b/cases/function/bsp/bsp-test.sh
index 7c80cd1..5627c30 100755
--- a/cases/function/bsp/bsp-test.sh
+++ b/cases/function/bsp/bsp-test.sh
@@ -12,6 +12,10 @@ cat <<-EOF
EOF
+export ROOT=`(cd ../../../; pwd)`
+
+. $ROOT/lib/functions.sh
+
#default cycle to run
ROUND=10
diff --git a/cases/function/bsp/runtest.sh b/cases/function/bsp/runtest.sh
index 9940711..90311f2 100755
--- a/cases/function/bsp/runtest.sh
+++ b/cases/function/bsp/runtest.sh
@@ -35,11 +35,6 @@ mce-test/cases/function/bsp/log/*.bsplog
EOF
-#export ROOT=`(cd ../../../; pwd)`
-export ROOT=`pwd`
-
-. $ROOT/lib/functions.sh
-
TMP="../../../work"
TMP_DIR=${TMP_DIR:-$TMP}
if [ ! -d $TMP_DIR ]; then
@@ -47,15 +42,15 @@ if [ ! -d $TMP_DIR ]; then
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
+#$TMP_DIR can be absolute/relative path. Utilize it to locate BSP directory
+export BSP_DIR=`(cd $TMP_DIR; cd ../cases/function/bsp; pwd)`
+export BSP_LOG_DIR=$BSP_DIR/log
export BSP_LOG=$BSP_LOG_DIR/$(date +%Y-%m-%d.%H.%M.%S)-`uname -r`.bsplog
export OUTPUT_LOG=$BSP_LOG_DIR/$(date +%Y-%m-%d.%H.%M.%S)-`uname -r`.output
-export FAILST=$TMP_DIR/fail.list
-NUM_FAIL_CPU=`grep "CPU" $FAILST |wc -l`
-NUM_PASS_CPU=`expr $NUM_CPU - $NUM_FAIL_CPU`
+export NUM_CPU=`ls -d /sys/devices/system/cpu/cpu[0-9]* | wc -l`
+export MAX_CPU=`expr $NUM_CPU - 1`
+export FAILST=$TMP_DIR/fail.list
mkdir -p $BSP_LOG_DIR
touch $FAILST
@@ -80,6 +75,9 @@ and test again. Exiting..."
screen ./bsp-test.sh
+ NUM_FAIL_CPU=`grep "CPU" $FAILST |wc -l`
+ NUM_PASS_CPU=`expr $NUM_CPU - $NUM_FAIL_CPU`
+
echo "Total CPU Test: $NUM_CPU"
echo "Total CPU Pass: $NUM_PASS_CPU"
echo "Total CPU Fail: $NUM_FAIL_CPU"