runTestsuite.sh 946 B

1234567891011121314151617181920212223242526272829303132333435
  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. if [ x"$WORK_DIR" != x ] ; then
  8. export AST_WORK_DIR="$(readlink -f $WORK_DIR)"
  9. mkdir -p "$AST_WORK_DIR"
  10. fi
  11. pushd $TESTSUITE_DIR
  12. ./cleanup-test-remnants.sh
  13. if [ $REALTIME -eq 1 ] ; then
  14. $CIDIR/setupRealtime.sh --initialize-db=${INITIALIZE_DB:?0}
  15. fi
  16. export PYTHONPATH=./lib/python/
  17. echo "Running tests ${TESTSUITE_COMMAND} ${AST_WORK_DIR:+with work directory ${AST_WORK_DIR}}"
  18. ./runtests.py --cleanup --timeout=${TEST_TIMEOUT} ${TESTSUITE_COMMAND} | contrib/scripts/pretty_print --no-color --no-timer --term-width=120 --show-errors || :
  19. if [ $REALTIME -eq 1 ] ; then
  20. $CIDIR/teardownRealtime.sh --cleanup-db=${CLEANUP_DB:?0}
  21. fi
  22. if [ -f core* ] ; then
  23. echo "*** Found a core file after running unit tests ***"
  24. /var/lib/asterisk/scripts/ast_coredumper --no-default-search core*
  25. exit 1
  26. fi
  27. popd