root / snf-tools / conf / snf-burnin-details.sh @ e6ec7e85
History | View | Annotate | Download (588 Bytes)
1 |
#! /bin/bash |
---|---|
2 |
|
3 |
#Print the details for testcases that failed the last 30 minutes. |
4 |
#Usage: ./snf-burnin-details.sh LOG_FOLDER |
5 |
|
6 |
path=$1 |
7 |
flag=0 |
8 |
curr=$(date -d "30 minutes ago" +%Y%m%d%H%M%S) |
9 |
for dir in `find ${path} -maxdepth 1 -type d -cmin -60`; do |
10 |
|
11 |
if [ x"$dir" == "x${path}" ]; then |
12 |
continue |
13 |
fi |
14 |
for file in $dir/*/detail* ; do |
15 |
|
16 |
x=`dirname $file` |
17 |
y=`dirname $x` |
18 |
d=`basename $y` |
19 |
|
20 |
if (($d<$curr)); then |
21 |
if grep -E "(ERROR)|(FAILED)" "$file" >/dev/null; then |
22 |
cat "$file" |
23 |
flag=1 |
24 |
fi |
25 |
fi |
26 |
done |
27 |
done |
28 |
exit |
29 |
|
30 |
if [ $flag -ge 1 ]; then |
31 |
exit 1 |
32 |
else |
33 |
exit 0 |
34 |
fi |