From 26d6bcb31523d02de95844ce7b8a63b089c44131 Mon Sep 17 00:00:00 2001 From: Pete Vander Giessen Date: Thu, 10 Aug 2017 18:53:15 +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: I2542bf23435d3dbe5e399f1c938f3c9d879ed9ba --- .gitignore | 9 +++++++++ .../neutron/neutron.conf.d/database.conf | 2 ++ .../neutron/neutron.conf.d/keystone.conf | 13 +++++++++++++ .../snap-neutron/neutron/neutron.conf.d/nova.conf | 13 +++++++++++++ tests/neutron.sh | 6 ++++++ tests/neutron_cleanup.sh | 7 +++++++ 6 files changed, 50 insertions(+) create mode 100644 tests/etc/snap-neutron/neutron/neutron.conf.d/database.conf create mode 100644 tests/etc/snap-neutron/neutron/neutron.conf.d/keystone.conf create mode 100644 tests/etc/snap-neutron/neutron/neutron.conf.d/nova.conf create mode 100755 tests/neutron_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-neutron/neutron/neutron.conf.d/database.conf b/tests/etc/snap-neutron/neutron/neutron.conf.d/database.conf new file mode 100644 index 0000000..1028c5c --- /dev/null +++ b/tests/etc/snap-neutron/neutron/neutron.conf.d/database.conf @@ -0,0 +1,2 @@ +[database] +connection = mysql+pymysql://neutron:neutron@localhost/neutron diff --git a/tests/etc/snap-neutron/neutron/neutron.conf.d/keystone.conf b/tests/etc/snap-neutron/neutron/neutron.conf.d/keystone.conf new file mode 100644 index 0000000..2a77ab0 --- /dev/null +++ b/tests/etc/snap-neutron/neutron/neutron.conf.d/keystone.conf @@ -0,0 +1,13 @@ +[DEFAULT] +auth_strategy = keystone + +[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 = neutron +password = neutron diff --git a/tests/etc/snap-neutron/neutron/neutron.conf.d/nova.conf b/tests/etc/snap-neutron/neutron/neutron.conf.d/nova.conf new file mode 100644 index 0000000..5eac5aa --- /dev/null +++ b/tests/etc/snap-neutron/neutron/neutron.conf.d/nova.conf @@ -0,0 +1,13 @@ +[DEFAULT] +notify_nova_on_port_status_changes = True +notify_nova_on_port_data_changes = True + +[nova] +auth_url = http://localhost:35357 +auth_type = password +project_domain_name = default +user_domain_name = default +region_name = RegionOne +project_name = service +username = nova +password = nova diff --git a/tests/neutron.sh b/tests/neutron.sh index ad7f4e6..3ef4827 100755 --- a/tests/neutron.sh +++ b/tests/neutron.sh @@ -2,6 +2,12 @@ set -ex +sudo mysql -u root << EOF +CREATE DATABASE IF NOT EXISTS neutron; +GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost' \ + IDENTIFIED BY 'neutron'; +EOF + source $BASE_DIR/admin-openrc openstack user show neutron || { diff --git a/tests/neutron_cleanup.sh b/tests/neutron_cleanup.sh new file mode 100755 index 0000000..7886a0b --- /dev/null +++ b/tests/neutron_cleanup.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -x + +sudo mysql -u root << EOF +DROP DATABASE neutron; +EOF