summaryrefslogtreecommitdiffstats
path: root/scripts/run_tests
blob: 8e4d65e9f8f9b7c40b4eba38e518d74ae5f8ce88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

WAIT_FOR_RESULT='N'
if [ $# -ge 1 ] ; then
    if [ "$1" = "--wait-on-beaker-job" ] ; then
        WAIT_FOR_RESULT="Y"
    else
        echo "Unrecognized option. Usage: ./runtests --wait-on-beaker-job(Optional)"
    fi
fi
COMPOSE_PWD=`dirname $0 | cd; pwd`

TEST_PACKAGE=`cd $COMPOSE_PWD/../../package.tests; pwd`

if [ ! -d $TEST_PACKAGE ] ; then
    echo "Cannot run tests on beaker. Please compose the test rpms."
    exit -1
fi

cd $TEST_PACKAGE

bkr task-add *.rpm

if [ "$WAIT_FOR_RESULT" = "Y" ] ; then
    bkr job-submit --wait *.xml
else
    bkr job-submit *.xml
fi