Commit 00becd3f authored by John Giannelos's avatar John Giannelos
Browse files

Split cronjob example to snf-burnin run and check scripts

parent 2cac78bb
#! /bin/bash
#Example script to check current status.
#Checks for testcases that failed the last 30 minutes in a given folder.
#Usage: ./check-burnin-output.sh LOG_FOLDER
curr=$(date -d "30 minutes ago" +%Y%m%d%H%M%S)
for dir in ${1}/* ; do
d=`basename $dir`
if (($d>$curr)); then
if find "$dir"/* -type f -size +0 | grep failed >/dev/null; then
echo snf-burnin encountered a testcase failure. See log for details...
exit 1
fi
echo No testcase failure encountered...
exit 0
fi
done
\ No newline at end of file
#! /bin/bash
#Example script for an snf-burnin cronjob.
#Starts an a snf-burnin test, deletes stale instances and archives old logs.
#It aborts if snf-burnin runs for longer than expected.
#Usage: ./snf-burnin.cron.example TOKEN IMAGE-ID LOG-FOLDER
timeout 28m snf-burnin --token="$1" --image-id="$2" --action-timeout 120 --log-folder "$3"
snf-burnin --token="$1" --delete-stale
#Delete old folders
old=$(date -d "1 week ago" +%Y%m%d%H%M%S)
for dir in ${3}/* ; do
d=`basename $dir`
(($d<$old)) && rm -r "$dir"
done
#! /bin/bash
#Example script for an snf-burnin cronjob
#Usage snf-burnin.cron.example TOKEN IMAGE-ID LOG-FOLDER
snf-burnin --token="$1" --delete-stale
snf-burnin --token="$1" --image-id="$2" --action-timeout 120 --log-folder "$3"
#Delete old folders
old=$(date -d "30 minutes ago" +%Y%m%d%H%M%S)
for dir in ${3}/* ; do
d=`basename $dir`
(($d<$old)) && rm -r "$dir"
done
#Check for failed testcases
curr=$(date -d "30 minutes ago" +%Y%m%d%H%M%S)
for dir in ${3}/* ; do
d=`basename $dir`
if (($d>$curr)); then
if find "$dir"/* -type f -size +0 | grep failed >/dev/null; then
echo snf-burnin encountered a test failure. See log for details...
exit 1
fi
echo No testcase failure encountered
exit 0
fi
done
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment