aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Gong <gong.chen@linux.intel.com>2012-09-14 03:37:19 -0400
committerChen Gong <gong.chen@linux.intel.com>2012-09-18 03:55:03 -0400
commitff1dcca1138df58e486c08884ab191a9c1b1c807 (patch)
tree8a665d7f4b476f71aa425c674db189662aa7e403
parent62dc0d3385c9a8c425e2ee42f2d9be87389abc98 (diff)
downloadmce-test-ff1dcca1138df58e486c08884ab191a9c1b1c807.tar.gz
Add timeout condition in the PFA test
On some platforms PFA will not be triggered so that the PFA test can't finish. So the timeout functionality is necessary to avoid endless PFA test. Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
-rwxr-xr-xcases/function/pfa/run_pfa.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/cases/function/pfa/run_pfa.sh b/cases/function/pfa/run_pfa.sh
index 6ac0fec..fe97aed 100755
--- a/cases/function/pfa/run_pfa.sh
+++ b/cases/function/pfa/run_pfa.sh
@@ -75,15 +75,21 @@ main()
sleep 1
addr=`cat log |cut -d' ' -f8|tail -1`
last_addr=$addr
+ start=`date +%s`
while :
do
echo inject address = $addr
apei_inj $addr
sleep $2
addr=`cat log |cut -d' ' -f8|tail -1`
+ end=`date +%s`
+ timeout=`expr $end - $start`
if [ X"$last_addr" != X"$addr" ]
then
break
+ # assume it is enough to trigger PFA in 5 minutes
+ elif [ $timeout -ge 300 ]; then
+ invalid "Timeout! PFA is not triggered"
fi
done
}