Current plan: have two docker images for testing - one with the db and one with the gw.
Then run tests in /ironapi-gw/t against that setup.
!/bin/bash
# APIKEY for root tests:
APIKEY=5b3d776d-f6cd-4f49-9b88-a8e38c197d9e
DBHOST=46.101.130.36
DBUSER=root
#terminate all connections before trying to drop the database
psql -h $DBHOST -Atqc "SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = 'test'" template1 $DBUSER
# wait a moment for all connections to be terminated
sleep 2
#drop the database
dropdb --if-exists -U postgres -h 46.101.130.36 test
#create a new copy of the genesis core
createdb -U postgres -T genesis -O postgres -h 46.101.130.36 test