summaryrefslogtreecommitdiff
path: root/tools/test-setup.sh
diff options
context:
space:
mode:
authorTobias Henkel <tobias.henkel@bmw.de>2018-03-04 08:36:03 +0000
committerTobias Henkel <tobias.henkel@bmw.de>2018-04-10 15:51:25 +0200
commit267d134b7e881071e25bc46abdfb3bb86467bcc2 (patch)
tree912f071afdf9f69e90064abc4025108fdfa2fb11 /tools/test-setup.sh
parent851ab84c7ee688e2e3f8744c139e93a8992c194c (diff)
downloadzuul-267d134b7e881071e25bc46abdfb3bb86467bcc2.tar.gz
Add tests for postgresql
Some deployments use postgres as database backend. In order to have official support for that we need to add tests for it. Change-Id: I36408c27ccb36fd0826d97f34d98b211ee075f4e Depends-On: https://review.openstack.org/535718
Diffstat (limited to 'tools/test-setup.sh')
-rwxr-xr-xtools/test-setup.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/test-setup.sh b/tools/test-setup.sh
index 9712ae8ed..674fa585d 100755
--- a/tools/test-setup.sh
+++ b/tools/test-setup.sh
@@ -9,6 +9,7 @@ TOOLSDIR=$(dirname $0)
# Be sure mysql and zookeeper are started.
sudo service mysql start
+sudo service postgresql start
sudo service zookeeper start
# The root password for the MySQL database; pass it in via
@@ -37,6 +38,10 @@ mysql -u $DB_USER -p$DB_PW -h 127.0.0.1 -e "
DROP DATABASE IF EXISTS openstack_citest;
CREATE DATABASE openstack_citest CHARACTER SET utf8;"
+# setup postgres user and database
+sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN SUPERUSER UNENCRYPTED PASSWORD '$DB_PW';"
+sudo -u postgres psql -c "CREATE DATABASE openstack_citest OWNER $DB_USER TEMPLATE template0 ENCODING 'UTF8';"
+
# TODO(pabelanger): Move this into bindep after we figure out how to enable our
# PPA.
# NOTE(pabelanger): Avoid hitting http://keyserver.ubuntu.com