aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWen Jin <wenx.jin@intel.com>2016-03-22 11:11:35 +0800
committerAndi Kleen <ak@linux.intel.com>2016-04-11 15:32:38 -0700
commitf35fc30b6ff6aa554008619d0bd6962a7d281959 (patch)
treec48a29e336807ecd7f117ab8c0059d8e83b80641
parentb98fb78460933aff5ee58b73ea656f5c1c2c8a7b (diff)
downloadmce-test-f35fc30b6ff6aa554008619d0bd6962a7d281959.tar.gz
Drop obsolete test case "simple_process"
1. Use "victim" replacing "simple_process" 2. Remove mcelog related codes , which is useless for the test result 3. Check dmesg every time in wait loop to get test result 4. Increase delay time because of print rate limitation in kernel Signed-off-by: Wen Jin <wenx.jin@intel.com> Signed-off-by: Chen, Gong <gong.chen@linux.intel.com> Signed-off-by: Andi Kleen <ak@linux.intel.com>
-rwxr-xr-xcases/function/apei-inj/apei-inject.sh32
-rwxr-xr-xcases/function/einj-ext/einj-ext.sh35
-rwxr-xr-xcases/function/emca-inj/emca-inject.sh21
3 files changed, 59 insertions, 29 deletions
diff --git a/cases/function/apei-inj/apei-inject.sh b/cases/function/apei-inj/apei-inject.sh
index 07b6d86..69084c2 100755
--- a/cases/function/apei-inj/apei-inject.sh
+++ b/cases/function/apei-inj/apei-inject.sh
@@ -38,11 +38,9 @@ check_result()
uname -a >> $LOG
cat /etc/issue >> $LOG
echo -e "\n<<< dmesg information is as follows >>>\n" >> $LOG
- dmesg -c >> $LOG 2>&1
- echo -e "\n<<< mcelog information as follows >>>\n" >> $LOG
- mcelog >> $LOG 2>&1
while [ $time -lt $timeout ]
do
+ dmesg -c >> $LOG 2>&1
grep -q "$GHES_REC" $LOG
if [ $? -eq 0 ]
then
@@ -50,6 +48,7 @@ check_result()
echo 0 >> $TMP_DIR/error.$$
return
fi
+ sleep $sleep
time=`expr $time + $sleep`
done
echo -e "\nGHES record is not expected\n" |tee -a $LOG
@@ -81,18 +80,22 @@ main()
check_err_type $type
[ $? -ne 0 ] && return 1
- mcelog &> /dev/null
echo $type > $APEI_IF/error_type
- killall simple_process &> /dev/null
- simple_process > /dev/null &
- page-types -p `pidof simple_process` -LN -b ano > $TMP_DIR/pagelist.$$
-
- ADDR=`awk '$2 != "offset" {print "0x"$2"000"}' $TMP_DIR/pagelist.$$ | sed -n -e '1p'`
+ killall victim &> /dev/null
+ touch trigger
+ tail -f trigger --pid=$$ | victim -d > $TMP_DIR/pagelist.$$ &
+ sleep 1
+ ADDR=`cat $TMP_DIR/pagelist.$$ | awk '{print $NF}' | head -n 1`
if [ -f $APEI_IF/param1 ]
then
echo $ADDR > $APEI_IF/param1
echo 0xfffffffffffff000 > $APEI_IF/param2
+ echo 1 > $APEI_IF/notrigger
+ else
+ killall victim &> /dev/null
+ rm -f trigger
+ die "$APEI_IF/param'1-2' are missed! Ensure your BIOS supporting it and enabled."
fi
echo "1" > $APEI_IF/error_inject
@@ -106,10 +109,19 @@ main()
$LOG
EOF
- } && echo 1 > $TMP_DIR/error.$$
+ killall victim &> /dev/null
+ rm -f trigger
+ echo 1 > $TMP_DIR/error.$$
+ echo -e "\nTest FAILED\n"
+ exit 1
+ }
sleep 1
+ echo go > trigger
+ sleep 3
check_result
+ killall victim &> /dev/null
+ rm -f trigger
grep -q "1" $TMP_DIR/error.$$
if [ $? -eq 0 ]
then
diff --git a/cases/function/einj-ext/einj-ext.sh b/cases/function/einj-ext/einj-ext.sh
index c095de2..5ced964 100755
--- a/cases/function/einj-ext/einj-ext.sh
+++ b/cases/function/einj-ext/einj-ext.sh
@@ -70,13 +70,12 @@ check_result()
uname -a >> $LOG
cat /etc/issue >> $LOG
echo -e "\ndmesg information as follows:\n" >> $LOG
- dmesg -c >> $LOG 2>&1
- echo -e "\nmcelog information as follows:\n" >> $LOG
- mcelog >> $LOG 2>&1
while [ $time -lt $timeout ]
do
+ dmesg -c >> $LOG 2>&1
grep -q "$GHES_REC" $LOG
[ $? -eq 0 ] && return 0
+ sleep $sleep
time=`expr $time + $sleep`
done
return 1
@@ -91,19 +90,22 @@ einj_inj()
local type=0x8
check_err_type $type
[ $? -ne 0 ] && return 1
- mcelog &> /dev/null
echo $type > $APEI_IF/error_type
- killall simple_process > /dev/null 2>&1
- #killall simple_process &> /dev/null
- simple_process > /dev/null &
- page-types -p `pidof simple_process` -LN -b ano > $TMP_DIR/pagelist.$$
-
- ADDR=`awk '$2 != "offset" {print "0x"$2"000"}' $TMP_DIR/pagelist.$$ | sed -n -e '1p'`
+ killall victim &> /dev/null
+ touch trigger
+ tail -f trigger --pid=$$ | victim -d > $TMP_DIR/pagelist.$$ &
+ sleep 1
+ ADDR=`cat $TMP_DIR/pagelist.$$ | awk '{print $NF}' | head -n 1`
if [ -f $APEI_IF/param1 ]
then
echo $ADDR > $APEI_IF/param1
echo 0xfffffffffffff000 > $APEI_IF/param2
+ echo 1 > $APEI_IF/notrigger
+ else
+ killall victim &> /dev/null
+ rm -f trigger
+ die "$APEI_IF/param'1-2' are missed! Ensure your BIOS supporting it and enabled."
fi
echo "1" > $APEI_IF/error_inject
@@ -119,20 +121,27 @@ einj_inj()
***************************************************************************
EOF
- } && echo 1 > $TMP_DIR/error.$$
+ killall victim &> /dev/null
+ rm -f trigger
+ echo 1 > $TMP_DIR/error.$$
+ echo -e "\nTest FAILED\n"
+ exit 1
+ }
sleep 1
+ echo go > trigger
+ sleep 3
check_result
if [ $? -eq 0 ]
then
echo -e "\nEINJ Injection: GHES record is OK" |tee -a $LOG
echo 0 >> $TMP_DIR/error.$$
- return
else
echo -e "\nEINJ Injection: GHES record is not expected" |tee -a $LOG
echo 1 > $TMP_DIR/error.$$
- return 1
fi
+ killall victim &> /dev/null
+ rm -f trigger
}
vendor_inj()
diff --git a/cases/function/emca-inj/emca-inject.sh b/cases/function/emca-inj/emca-inject.sh
index d48bc1d..5f21115 100755
--- a/cases/function/emca-inj/emca-inject.sh
+++ b/cases/function/emca-inj/emca-inject.sh
@@ -38,9 +38,9 @@ check_result()
uname -a >> $LOG
cat /etc/issue >> $LOG
echo -e "\n<<< dmesg is as below >>>\n" >> $LOG
- dmesg -c >> $LOG 2>&1
while [ $time -lt $timeout ]
do
+ dmesg -c >> $LOG 2>&1
grep -q "$eMCA_REC" $LOG
if [ $? -eq 0 ]
then
@@ -85,17 +85,19 @@ main()
[ $? -ne 0 ] && return 1
sleep 2
echo $type > $APEI_IF/error_type
- killall simple_process &> /dev/null
- simple_process > /dev/null &
- page-types -p `pidof simple_process` -LN -b ano > $TMP_DIR/pagelist.$$
- ADDR=`awk '$2 != "offset" {print "0x"$2"000"}' $TMP_DIR/pagelist.$$ | sed -n -e '1p'`
+ killall victim &> /dev/null
+ touch trigger
+ tail -f trigger --pid=$$ | victim -d > $TMP_DIR/pagelist.$$ &
+ sleep 1
+ ADDR=`cat $TMP_DIR/pagelist.$$ | awk '{print $NF}' | head -n 1`
if [ -f $APEI_IF/param1 ]
then
echo $ADDR > $APEI_IF/param1
echo 0xfffffffffffff000 > $APEI_IF/param2
echo 1 > $APEI_IF/notrigger
else
+ killall victim &> /dev/null
clean_up_eMCA
die "$APEI_IF/param'1-2' are missed! Ensure your BIOS supporting it and enabled."
fi
@@ -108,15 +110,22 @@ main()
$LOG
EOF
+ killall victim &> /dev/null
clean_up_eMCA
+ echo 1 > $TMP_DIR/emca.$$
+ echo -e "\nTest FAILED\n"
return 1
fi
-
sleep 1
+ echo go > trigger
+ sleep 3
+
check_result
grep -q "0" $TMP_DIR/emca.$$
ret=$?
clean_up_eMCA
+ killall victim &> /dev/null
+ rm -f trigger
if [ $ret -ne 0 ]
then
echo -e "\nTest FAILED\n"