Revision 56d5c612

b/snf-tools/conf/snf-burnin-output.sh
1
#! /bin/bash
2

  
3
#Example script to check current status. 
4
#Checks for testcases that failed the last 30 minutes in a given folder.
5
 
6
#Usage: ./check-burnin-output.sh LOG_FOLDER
7

  
8
curr=$(date -d "30 minutes ago" +%Y%m%d%H%M%S)
9
for dir in ${1}/* ; do
10
    d=`basename $dir`
11
    if (($d>$curr)); then
12
	if find "$dir"/* -type f -size +0 | grep failed >/dev/null; then
13
	    echo snf-burnin encountered a testcase failure. See log for details...
14
	    exit 1
15
	fi
16
	echo No testcase failure encountered...
17
	exit 0
18
    fi
19
done
b/snf-tools/conf/snf-burnin-run.sh
1
#! /bin/bash
2

  
3
#Example script for an snf-burnin cronjob.
4
#Starts an a snf-burnin test, deletes stale instances and archives old logs.
5
#It aborts if snf-burnin runs for longer than expected.
6

  
7
#Usage: ./snf-burnin.cron.example TOKEN IMAGE-ID LOG-FOLDER
8

  
9
timeout 28m snf-burnin --token="$1" --image-id="$2" --action-timeout 120 --log-folder "$3"
10
snf-burnin --token="$1" --delete-stale
11

  
12
#Delete old folders
13
old=$(date -d "1 week ago" +%Y%m%d%H%M%S)
14
for dir in ${3}/* ; do
15
    d=`basename $dir`
16
    (($d<$old)) && rm -r "$dir"
17
done
/dev/null
1
#! /bin/bash
2

  
3
#Example script for an snf-burnin cronjob
4
#Usage snf-burnin.cron.example TOKEN IMAGE-ID LOG-FOLDER
5

  
6
snf-burnin --token="$1" --delete-stale
7
snf-burnin --token="$1" --image-id="$2" --action-timeout 120 --log-folder "$3"
8

  
9
#Delete old folders
10
old=$(date -d "30 minutes ago" +%Y%m%d%H%M%S)
11
for dir in ${3}/* ; do
12
    d=`basename $dir`
13
    (($d<$old)) && rm -r "$dir"
14
done
15

  
16
#Check for failed testcases
17
curr=$(date -d "30 minutes ago" +%Y%m%d%H%M%S)
18
for dir in ${3}/* ; do
19
    d=`basename $dir`
20
    if (($d>$curr)); then
21
	if find "$dir"/* -type f -size +0 | grep failed >/dev/null; then
22
	    echo snf-burnin encountered a test failure. See log for details...
23
	    exit 1
24
	fi
25
	echo No testcase failure encountered
26
	exit 0
27
    fi
28
done

Also available in: Unified diff