Commit e4971177 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Merge branch 'snf-tools'

parents c790169c c628e197
......@@ -4,8 +4,44 @@ README
snf-burnin is an integration testing tool for a running Synnefo deployment.
It runs test scenarios from the following categories:
*Authentication
*Images
*Flavors
*Servers
*Networking
- Authentication
- Images
- Flavors
- Servers
- Networking
======
Usage
======
Example:
--------
snf-burnin --api=API_URL --token=TOKEN --image-id=IMAGE-ID --log-folder=LOG_FOLDER
For more options:
------------------
snf-burnin --help
==========
Log files
==========
In each run, snf-burnin stores log files in the folder defined in the --log-folder parameter (default is /var/log/burnin) under the folder with the timestamp of the snf-burnin-run and the image used for it. The name prefixes of the log files are:
- details: Showing the complete log of snf-burnin run.
- error: Showing the testcases that encountered a runtime error.
- failed: Showing the testcases that encountered a failure.
Example scripts
-----------------
Under /snf-tools/conf/ you can find example scripts for automating snf-burnin testing using cron.
- **snf-burnin-run.sh** runs snf-burnin with the given parameters, deletes stale instances (servers, networks) from old runs and delete logs older than a week. It aborts if snf-burnin runs for longer than expected.
- **Usage**: ./snf-burnin-run.sh TOKEN IMAGE-ID LOG_FOLDER
- **snf-burnin-output.sh** checks for failed snf-burnin tests the last 30 minutes in a given log folder. Exit status is 0 if no failures where encountered, else exit status is 1.
- **Usage**: ./snf-burnin-output.sh LOG_FOLDER
\ No newline at end of file
#! /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-run.sh TOKEN IMAGE-ID LOG-FOLDER
timeout --foreground 25m 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