CI: Add --test-timeout option to runTestsuite.sh
[asterisk/asterisk.git] / tests / CI / runTestsuite.sh
1 #!/usr/bin/env bash
2 CIDIR=$(dirname $(readlink -fn $0))
3 REALTIME=0
4 TEST_TIMEOUT=600
5 source $CIDIR/ci.functions
6 ASTETCDIR=$DESTDIR/etc/asterisk
7
8 pushd $TESTSUITE_DIR
9
10 ./cleanup-test-remnants.sh
11
12 if [ $REALTIME -eq 1 ] ; then
13         $CIDIR/setupRealtime.sh --initialize-db=${INITIALIZE_DB:?0}
14 fi
15
16 export PYTHONPATH=./lib/python/
17 echo "Running tests ${TESTSUITE_COMMAND}"
18 ./runtests.py --cleanup --timeout=${TEST_TIMEOUT} ${TESTSUITE_COMMAND} | contrib/scripts/pretty_print --no-color --no-timer --term-width=120 --show-errors || :
19
20 if [ $REALTIME -eq 1 ] ; then
21         $CIDIR/teardownRealtime.sh --cleanup-db=${CLEANUP_DB:?0}
22 fi
23
24 if [ -f core* ] ; then
25         echo "*** Found a core file after running unit tests ***"
26         /var/lib/asterisk/scripts/ast_coredumper --no-default-search core*
27         exit 1
28 fi
29
30 popd