From 493a7aeb965787a6143dc43cd21e9b02949f247f Mon Sep 17 00:00:00 2001 From: Pete Vander Giessen Date: Wed, 9 Aug 2017 21:40:23 +0000 Subject: [PATCH] Added config files to snap. Part of a transition to storing the config files in the snap, rather than in snapstack. Also updated .gitignore to ignore emacs temp files and snapcraft cruft. Change-Id: Ic32b6e6b3665db9a43878b91c9288a408c8a8c0e --- .gitignore | 9 +++++++++ .../snap-glance/glance/glance.conf.d/database.conf | 2 ++ .../snap-glance/glance/glance.conf.d/keystone.conf | 13 +++++++++++++ tests/glance.sh | 7 +++++++ tests/glance_cleanup.sh | 7 +++++++ 5 files changed, 38 insertions(+) create mode 100644 tests/etc/snap-glance/glance/glance.conf.d/database.conf create mode 100644 tests/etc/snap-glance/glance/glance.conf.d/keystone.conf create mode 100755 tests/glance_cleanup.sh 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"""