diff --git a/.gitignore b/.gitignore index 07ee36e..be29be6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,12 @@ prime stage *.snap .tox + +# Snapcraft +.snapcraft +__pycache__ +.cache + +# emacs +*~ +\#* diff --git a/tests/etc/snap-keystone/keystone/keystone.conf.d/database.conf b/tests/etc/snap-keystone/keystone/keystone.conf.d/database.conf new file mode 100644 index 0000000..e551120 --- /dev/null +++ b/tests/etc/snap-keystone/keystone/keystone.conf.d/database.conf @@ -0,0 +1,2 @@ +[database] +connection = mysql+pymysql://keystone:keystone@localhost/keystone diff --git a/tests/keystone.sh b/tests/keystone.sh index 5ecace8..daf2f4a 100755 --- a/tests/keystone.sh +++ b/tests/keystone.sh @@ -4,8 +4,16 @@ set -ex source $BASE_DIR/admin-openrc +sudo mysql -u root << EOF +CREATE DATABASE IF NOT EXISTS keystone; +GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' \ + IDENTIFIED BY 'keystone'; +EOF + while sudo [ ! -d /var/snap/keystone/common/etc/keystone/ ]; do sleep 0.1; done; sudo cp -r $BASE_DIR/etc/snap-keystone/* /var/snap/keystone/common/etc/ +# Uncomment when ready to move to using config files in snaps: +# sudo cp -r $BASE_DIR/etc/* /var/snap/keystone/common/etc/ # Manually define alias if snap isn't installed from snap store. # Otherwise, snap store defines this alias automatically. diff --git a/tests/keystone_cleanup.sh b/tests/keystone_cleanup.sh new file mode 100644 index 0000000..cb0a407 --- /dev/null +++ b/tests/keystone_cleanup.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -x + +sudo mysql -u root << EOF +DROP DATABASE keystone; +EOF