Add tests for autonomous service rerouting
[transportpce.git] / tests / launch_tests.sh
1 #!/bin/sh
2
3 if [ -n "$USE_ODL_ALT_KARAF_ENV" ]; then
4     echo "using environment variables from $USE_ODL_ALT_KARAF_ENV"
5     . $USE_ODL_ALT_KARAF_ENV
6 fi
7
8 for arg in $@; do
9     if [ -z "$test_suite" ]; then
10         test_suite=$1
11     else
12 # Tox reinterprets "olm" and "pce" by "../olm" "../pce" because of the
13 # changedir directive and the presence of modules folders "olm" and pce"
14 # at project root.
15         if [ "$arg" = "../olm" ]; then
16             arglist=$arglist" olm"
17         elif [ "$arg" = "../pce" ]; then
18             arglist=$arglist" pce"
19         else
20             arglist=$arglist" "$arg
21         fi
22     fi
23 done
24
25 scriptlist=""
26 if [ -z "$arglist" ]; then
27     scriptlist="transportpce_tests/$test_suite/test[0-9][0-9]_*.py"
28 else
29     for test in $arglist; do
30         scriptlist=$scriptlist" transportpce_tests/$test_suite/test[0-9][0-9]_$test.py"
31     done
32 fi
33 if [ -z "$LAUNCHER" ]; then
34     LAUNCHER="nosetests --with-xunit";
35 fi
36
37 for script in $scriptlist; do
38     echo $LAUNCHER $(ls $script)
39     $LAUNCHER $script || exit 1
40 done