CI: Add options to initialize and cleanup database to runTestsuite.sh

Change-Id: I352333233bab5377723bf37d490ba84fc55bc853
This commit is contained in:
George Joseph
2018-07-24 12:29:19 -06:00
parent af5984d694
commit 797835c5b9
4 changed files with 119 additions and 57 deletions

View File

@@ -1,6 +1,12 @@
#!/usr/bin/env bash
CIDIR=$(dirname $(readlink -fn $0))
CLEANUP_DB=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'
if [ $CLEANUP_DB -gt 0 ] ; then
sudo -u postgres dropdb -e asterisk_test >/dev/null 2>&1 || :
sudo -u postgres dropuser -e asterisk_test >/dev/null 2>&1 || :
sudo odbcinst -u -d -n "PostgreSQL-Asterisk-Test"
sudo odbcinst -u -s -l -n "asterisk-connector-test"
fi