blob: f9852f6be10ed431cb44ade09de1a3f89ae3961a [file] [log] [blame]
sandriichenko7ec32172018-03-19 17:21:21 +02001#!/bin/bash -xe
2
3if [ ! -f /etc/tempest/tempest.conf ]
4then
5 echo "Please put your tempest.conf file to /etc/tempest/"
6 exit 1
7fi
8
9if [ -n "${REPORT_SUFFIX}" ]
10then
11 report="report_${REPORT_SUFFIX}"
12else
13 report='report_'`date +%F_%H-%M`
14fi
15
16log=$LOG_DIR/$report.log
17
18cd $LOG_DIR
19rm -rf env
20tempest init env | tee -a $log
21cd env
22tempest run $PATTERN | tee -a $log
23
24if [[ "$PATTERN" =~ '-r ' || "$PATTERN" =~ '--regex' || "$PATTERN" =~ '-s' ]]; then
25 stestr last --subunit | subunit2junitxml > $LOG_DIR/$report.xml
26fi
27