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-glance/glance/glance.conf.d/database.conf b/tests/etc/snap-glance/glance/glance.conf.d/database.conf new file mode 100644 index 0000000..d41f73f --- /dev/null +++ b/tests/etc/snap-glance/glance/glance.conf.d/database.conf @@ -0,0 +1,2 @@ +[database] +connection = mysql+pymysql://glance:glance@localhost/glance diff --git a/tests/etc/snap-glance/glance/glance.conf.d/keystone.conf b/tests/etc/snap-glance/glance/glance.conf.d/keystone.conf new file mode 100644 index 0000000..f3490e0 --- /dev/null +++ b/tests/etc/snap-glance/glance/glance.conf.d/keystone.conf @@ -0,0 +1,13 @@ +[keystone_authtoken] +auth_uri = http://localhost:5000 +auth_url = http://localhost:35357 +memcached_servers = localhost:11211 +auth_type = password +project_domain_name = default +user_domain_name = default +project_name = service +username = glance +password = glance + +[paste_deploy] +flavor = keystone diff --git a/tests/glance.sh b/tests/glance.sh index fd287cf..30097df 100755 --- a/tests/glance.sh +++ b/tests/glance.sh @@ -4,8 +4,15 @@ set -ex source $BASE_DIR/admin-openrc +sudo mysql -u root << EOF +CREATE DATABASE IF NOT EXISTS glance; +GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \ + IDENTIFIED BY 'glance'; +EOF + while sudo [ ! -d /var/snap/glance/common/etc/glance/ ]; do sleep 0.1; done; sudo cp -r $BASE_DIR/etc/snap-glance/* /var/snap/glance/common/etc/ +# sudo cp -r $BASE_DIR/etc/* /var/snap/glance/common/etc/ openstack user show glance || { openstack user create --domain default --password glance glance diff --git a/tests/glance_cleanup.sh b/tests/glance_cleanup.sh new file mode 100755 index 0000000..eecdcda --- /dev/null +++ b/tests/glance_cleanup.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -ex + +sudo mysql -u root << EOF +DROP DATABASE glance; +EOF"""