]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
CI: Add teardownRealtime
authorGeorge Joseph <gjoseph@digium.com>
Tue, 17 Jul 2018 09:03:02 +0000 (03:03 -0600)
committerGeorge Joseph <gjoseph@digium.com>
Tue, 17 Jul 2018 09:04:03 +0000 (03:04 -0600)
Change-Id: I2fe55c38607eaec2fbf69ef23a5019e0c443a64b

tests/CI/runTestsuite.sh
tests/CI/setupRealtime.sh
tests/CI/teardownRealtime.sh [new file with mode: 0755]

index 35f4d589481002a71ffcc9ee47ee35b9f446f15c..9261308299e816a16534a7c282c3520241f87dec 100755 (executable)
@@ -16,6 +16,10 @@ export PYTHONPATH=./lib/python/
 echo "Running tests ${TEST_COMMAND}"
 ./runtests.py --cleanup ${TEST_COMMAND} | contrib/scripts/pretty_print --no-color --no-timer --term-width=120 --show-errors || :
 
+if [ $REALTIME -eq 0 ] ; then
+       $CIDIR/teardownRealtime.sh
+fi
+
 if [ -f core* ] ; then
        echo "*** Found a core file after running unit tests ***"
        /var/lib/asterisk/scripts/ast_coredumper --no-default-search core*
index 01593a1060e157ba9d5a325724e854049eb7e010..f599d335e09f8630b9c66e688f12945d0b25818d 100755 (executable)
@@ -4,7 +4,9 @@ source $CIDIR/ci.functions
 
 set -e
 
-cat >test-config.yaml <<EOF
+cp test-config.yaml test-config.orig.yaml
+
+cat >test-config.yaml <<-EOF
        global-settings:
            test-configuration: config-realtime
 
diff --git a/tests/CI/teardownRealtime.sh b/tests/CI/teardownRealtime.sh
new file mode 100755 (executable)
index 0000000..1114699
--- /dev/null
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+CIDIR=$(dirname $(readlink -fn $0))
+source $CIDIR/ci.functions
+
+cp test-config.orig.yaml test-config.yaml
+psql --username=asterisk --host=localhost --db=asterisk --command='DROP OWNED BY asterisk CASCADE'