• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2#
3# Run mce test cases in a loop. It exits on failure of any one of the test cases.
4# This script is using simple test driver.
5#
6#   Authors: Dean Nelson <dnelson@redhat.com>
7#           iZheng Jiajia <jiajia.zheng@intel.com>
8# This file is released under the GPLv2.
9#
10# Usage:
11#Run as root and invoke this test tool on test configure file.
12#For example, ./loop-mce-test simple_ser.conf
13#Note that only simple test configure file is used and full path is not needed here.
14
15sd=$(dirname "$0")
16export ROOT=`(cd $sd/..; pwd)`
17prog=$(basename "$0")
18
19usage()
20{
21    echo "$prog <config>"
22    exit 1
23}
24
25. $ROOT/lib/functions.sh
26
27[ $# -eq 1 ] || usage
28config=$(basename "$1")
29[ -f $ROOT/config/$config ] || usage
30
31i=0
32while true ; do
33	((i=i+1))
34	echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!! loop $i"
35	rm $ROOT/results/simple/result
36
37	sh $ROOT/drivers/simple/driver.sh $ROOT/config/$1
38
39	sed -e'/gcov/d' $ROOT/results/simple/result | grep "Fail" > /dev/null
40	if [ $? = 0 ] ; then
41		echo "failed on loop $i"
42		exit 1
43	fi
44done
45
46