From 6f18583c9237bbb6906b748417f5a64fed6882be Mon Sep 17 00:00:00 2001 From: Pete Vander Giessen Date: Thu, 10 Aug 2017 15:07:52 +0000 Subject: [PATCH] Added config files to snap. This is 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: I917767c08e0daebdeb2392f2fc74ca3a3a1c57ac --- .gitignore | 9 +++++++++ .../etc/snap-nova/nova/nova.conf.d/database.conf | 5 +++++ tests/etc/snap-nova/nova/nova.conf.d/glance.conf | 2 ++ .../etc/snap-nova/nova/nova.conf.d/keystone.conf | 13 +++++++++++++ tests/etc/snap-nova/nova/nova.conf.d/neutron.conf | 15 +++++++++++++++ .../nova/nova.conf.d/nova-placement.conf | 9 +++++++++ .../etc/snap-nova/nova/nova.conf.d/rabbitmq.conf | 2 ++ .../etc/snap-nova/nova/nova.conf.d/scheduler.conf | 3 +++ tests/nova.sh | 12 ++++++++++++ tests/nova_cleanup.sh | 9 +++++++++ 10 files changed, 79 insertions(+) create mode 100644 tests/etc/snap-nova/nova/nova.conf.d/database.conf create mode 100644 tests/etc/snap-nova/nova/nova.conf.d/glance.conf create mode 100644 tests/etc/snap-nova/nova/nova.conf.d/keystone.conf create mode 100644 tests/etc/snap-nova/nova/nova.conf.d/neutron.conf create mode 100644 tests/etc/snap-nova/nova/nova.conf.d/nova-placement.conf create mode 100644 tests/etc/snap-nova/nova/nova.conf.d/rabbitmq.conf create mode 100644 tests/etc/snap-nova/nova/nova.conf.d/scheduler.conf create mode 100644 tests/nova_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-nova/nova/nova.conf.d/database.conf b/tests/etc/snap-nova/nova/nova.conf.d/database.conf new file mode 100644 index 0000000..c4666b4 --- /dev/null +++ b/tests/etc/snap-nova/nova/nova.conf.d/database.conf @@ -0,0 +1,5 @@ +[database] +connection = mysql+pymysql://nova:nova@localhost/nova + +[api_database] +connection = mysql+pymysql://nova:nova@localhost/nova_api diff --git a/tests/etc/snap-nova/nova/nova.conf.d/glance.conf b/tests/etc/snap-nova/nova/nova.conf.d/glance.conf new file mode 100644 index 0000000..3c7673b --- /dev/null +++ b/tests/etc/snap-nova/nova/nova.conf.d/glance.conf @@ -0,0 +1,2 @@ +[glance] +api_servers = http://localhost:9292 diff --git a/tests/etc/snap-nova/nova/nova.conf.d/keystone.conf b/tests/etc/snap-nova/nova/nova.conf.d/keystone.conf new file mode 100644 index 0000000..41d52c3 --- /dev/null +++ b/tests/etc/snap-nova/nova/nova.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 = nova +password = nova + +[paste_deploy] +flavor = keystone diff --git a/tests/etc/snap-nova/nova/nova.conf.d/neutron.conf b/tests/etc/snap-nova/nova/nova.conf.d/neutron.conf new file mode 100644 index 0000000..b40234c --- /dev/null +++ b/tests/etc/snap-nova/nova/nova.conf.d/neutron.conf @@ -0,0 +1,15 @@ +[DEFAULT] +use_neutron = True +firewall_driver = nova.virt.firewall.NoopFirewallDriver + +[neutron] +url = http://localhost:9696 +auth_url = http://localhost:35357 +memcached_servers = localhost:11211 +auth_type = password +project_domain_name = default +user_domain_name = default +region_name = RegionOne +project_name = service +username = neutron +password = neutron diff --git a/tests/etc/snap-nova/nova/nova.conf.d/nova-placement.conf b/tests/etc/snap-nova/nova/nova.conf.d/nova-placement.conf new file mode 100644 index 0000000..21901b1 --- /dev/null +++ b/tests/etc/snap-nova/nova/nova.conf.d/nova-placement.conf @@ -0,0 +1,9 @@ +[placement] +os_region_name = RegionOne +project_domain_name = default +project_name = service +auth_type = password +user_domain_name = default +auth_url = http://localhost:35357 +username = placement +password = placement diff --git a/tests/etc/snap-nova/nova/nova.conf.d/rabbitmq.conf b/tests/etc/snap-nova/nova/nova.conf.d/rabbitmq.conf new file mode 100644 index 0000000..7988700 --- /dev/null +++ b/tests/etc/snap-nova/nova/nova.conf.d/rabbitmq.conf @@ -0,0 +1,2 @@ +[DEFAULT] +transport_url = rabbit://openstack:rabbitmq@localhost diff --git a/tests/etc/snap-nova/nova/nova.conf.d/scheduler.conf b/tests/etc/snap-nova/nova/nova.conf.d/scheduler.conf new file mode 100644 index 0000000..6dc1b29 --- /dev/null +++ b/tests/etc/snap-nova/nova/nova.conf.d/scheduler.conf @@ -0,0 +1,3 @@ +[scheduler] +discover_hosts_in_cells_interval = 30 +scheduler_driver = filter_scheduler diff --git a/tests/nova.sh b/tests/nova.sh index bf660fa..90aa2a3 100755 --- a/tests/nova.sh +++ b/tests/nova.sh @@ -4,6 +4,18 @@ set -ex source $BASE_DIR/admin-openrc +sudo mysql -u root << EOF +CREATE DATABASE IF NOT EXISTS nova; +CREATE DATABASE IF NOT EXISTS nova_api; +CREATE DATABASE IF NOT EXISTS nova_cell0; +GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \ + IDENTIFIED BY 'nova'; +GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' \ + IDENTIFIED BY 'nova'; +GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' \ + IDENTIFIED BY 'nova'; +EOF + openstack user show nova || { openstack user create --domain default --password nova nova openstack role add --project service --user nova admin diff --git a/tests/nova_cleanup.sh b/tests/nova_cleanup.sh new file mode 100644 index 0000000..283c5f9 --- /dev/null +++ b/tests/nova_cleanup.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -x + +sudo mysql -u root << EOF +DROP DATABASE nova; +DROP DATABASE nova_api; +DROP DATABASE nova_cell0; +EOF