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>2015-01-21 21:24:00 -0500
commitb1fb2c6c9212d9c8936ff0f0f47e1037186a042f (patch)
tree8a665d7f4b476f71aa425c674db189662aa7e403
parent0dc287787bdb56bf792046255ca1bcc7a49b1425 (diff)
downloadmce-test-b1fb2c6c9212d9c8936ff0f0f47e1037186a042f.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
}