Add ability to configure handlers from pillar
- enabled handlers option placed in correct section for queens
- added ability to configure handlers for queens from pillar
- updated kitchen
- added kitchen verification
- removed unsupported liberty
Change-Id: I7eca089df75d317b018ddc989c57f8cf74a64cf4
Related-Prod: https://mirantis.jira.com/browse/PROD-24488
diff --git a/.kitchen.yml b/.kitchen.yml
index d4af7dc..db2ef8f 100644
--- a/.kitchen.yml
+++ b/.kitchen.yml
@@ -2,7 +2,7 @@
driver:
name: docker
hostname: designate.ci.local
- use_sudo: true
+ use_sudo: false
provisioner:
name: salt_solo
@@ -18,27 +18,67 @@
- name: linux
repo: git
source: https://github.com/salt-formulas/salt-formula-linux
- - name: mysql
+ - name: oslo_templates
repo: git
- source: https://github.com/salt-formulas/salt-formula-mysql
- - name: rabbitmq
- repo: git
- source: https://github.com/salt-formulas/salt-formula-rabbitmq
+ source: https://github.com/salt-formulas/salt-formula-oslo-templates
state_top:
base:
"*":
- linux
- - mysql
- - rabbitmq
- designate
pillars:
+ release.sls:
+ designate:
+ server:
+ version: <%= ENV['OS_VERSION'] || 'pike' %>
+ ssl.sls:
+ designate:
+ server:
+ identity:
+ protocol: https
+ database:
+ x509:
+ enabled: True
+ ca_file: /etc/designate/ssl/mysql/ca-cert.pem
+ key_file: /etc/designate/ssl/mysql/client-key.pem
+ cert_file: /etc/designate/ssl/mysql/client-cert.pem
+ cacert: |
+ -----BEGIN CERTIFICATE-----
+ MIIFzzCCA7egAwIBAgIIe7zZ8hCvkgowDQYJKoZIhvcNAQELBQAwSjELMAkGA1UE
+ -----END CERTIFICATE-----
+ cert: |
+ -----BEGIN CERTIFICATE-----
+ MIIGSjCCBDKgAwIBAgIJAIHRPs2rZbLvMA0GCSqGSIb3DQEBCwUAMEoxCzAJBgNV
+ -----END CERTIFICATE-----
+ key: |
+ -----BEGIN RSA PRIVATE KEY-----
+ MIIJKQIBAAKCAgEAq0m4kOIITliYea07yJnlSRNY0o6NaykiteSfHGauiub4lNQJ
+ -----END RSA PRIVATE KEY-----
+ ssl:
+ enabled: True
+ cacert_file: /etc/designate/ssl/mysql/ca-cert.pem
+ cacert: |
+ -----BEGIN CERTIFICATE-----
+ MIIFzzCCA7egAwIBAgIIe7zZ8hCvkgowDQYJKoZIhvcNAQELBQAwSjELMAkGA1UE
+ -----END CERTIFICATE-----
+ message_queue:
+ port: 5671
+ ssl:
+ enabled: True
+ cacert_file: /etc/designate/ssl/mysql/ca-cert.pem
+ cacert: |
+ -----BEGIN CERTIFICATE-----
+ MIIFzzCCA7egAwIBAgIIe7zZ8hCvkgowDQYJKoZIhvcNAQELBQAwSjELMAkGA1UE
+ -----END CERTIFICATE-----
+
top.sls:
base:
"*":
- linux_repo_openstack
- designate
+ - release
pillars-from-files:
- linux_repo_openstack.sls: tests/pillar/repo_mcp_openstack.sls
+ linux_repo_openstack.sls: tests/pillar/repo_mcp_openstack_<%= ENV['OS_VERSION'] || 'pike' %>.sls
verifier:
name: inspec
@@ -52,9 +92,56 @@
suites:
- - name: designate_without_backend
+ - name: server_cluster
provisioner:
pillars-from-files:
- designate.sls: tests/pillar/designate_ocata.sls
+ designate.sls: tests/pillar/server_cluster.sls
+ verifier:
+ inspec_tests:
+ - tests/integration/<%= ENV['OS_VERSION'] || 'pike'%>/server_cluster
+
+ - name: server_single
+ provisioner:
+ pillars-from-files:
+ designate.sls: tests/pillar/server_single.sls
+ verifier:
+ inspec_tests:
+ - tests/integration/<%= ENV['OS_VERSION'] || 'pike'%>/server_single
+
+ - name: server_cluster_ssl
+ provisioner:
+ pillars-from-files:
+ designate.sls: tests/pillar/server_cluster.sls
+ pillars:
+ top.sls:
+ base:
+ "*":
+ - linux_repo_openstack
+ - designate
+ - release
+ - ssl
+ verifier:
+ inspec_tests:
+ - tests/integration/<%= ENV['OS_VERSION'] || 'pike'%>/server_cluster
+ attributes:
+ ssl: true
+
+ - name: server_single_ssl
+ provisioner:
+ pillars-from-files:
+ designate.sls: tests/pillar/server_single.sls
+ pillars:
+ top.sls:
+ base:
+ "*":
+ - linux_repo_openstack
+ - designate
+ - release
+ - ssl
+ verifier:
+ inspec_tests:
+ - tests/integration/<%= ENV['OS_VERSION'] || 'pike'%>/server_single
+ attributes:
+ ssl: true
# vim: ft=yaml sw=2 ts=2 sts=2 tw=125
diff --git a/.travis.yml b/.travis.yml
index 75cdfa6..94bc08b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,8 +21,16 @@
- bundle install
env:
- - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2016.3 SUITE=designate-without-backend
- - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 SUITE=designate-without-backend
+ - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=ocata SUITE=server-cluster
+ - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=ocata SUITE=server-single
+ - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=pike SUITE=server-cluster
+ - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=pike SUITE=server-single
+ - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=pike SUITE=server-cluster-ssl
+ - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=pike SUITE=server-single-ssl
+ - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=queens SUITE=server-single
+ - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=queens SUITE=server-single-ssl
+ - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=queens SUITE=server-cluster
+ - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2017.7 OS_VERSION=queens SUITE=server-cluster-ssl
# - PLATFORM=epcim/salt:saltstack-ubuntu-xenial-salt-2018.3 SUITE=designate-without-backend
# - PLATFORM=epcim/salt:saltstack-ubuntu-bionic-salt-2017.7 SUITE=designate-without-backend
# - PLATFORM=epcim/salt:saltstack-ubuntu-bionic-salt-2018.3 SUITE=designate-without-backend
diff --git a/designate/agent.sls b/designate/agent.sls
index 4c96455..9cc5ca4 100644
--- a/designate/agent.sls
+++ b/designate/agent.sls
@@ -9,6 +9,9 @@
service.running:
- enable: true
- names: {{ agent.services }}
+ {%- if grains.get('noservices') %}
+ - onlyif: /bin/false
+ {%- endif %}
- watch:
- file: /etc/designate/designate.conf
{%- endif %}
diff --git a/designate/files/queens/designate.conf.Debian b/designate/files/queens/designate.conf.Debian
index d8c43a4..f27c6b8 100644
--- a/designate/files/queens/designate.conf.Debian
+++ b/designate/files/queens/designate.conf.Debian
@@ -252,67 +252,13 @@
{%- endif %}
-[handler:neutron_floatingip]
+{%- for name, _data in server.notification_handlers.iteritems() %}
+{%- if not _data.get('zone_id') %}
+ {%- do _data.update({'zone_id': server.domain_id}) %}
+{%- endif %}
-#
-# From designate.opts
-#
-
-# notification any events from neutron (list value)
-#notification_topics = notifications
-
-# control-exchange for neutron notification (string value)
-#control_exchange = neutron
-
-# Zone ID with each notification (string value)
-#zone_id = <None>
-zone_id = {{ server.domain_id }}
-
-# IPv4 format (multi valued)
-#formatv4 =
-formatv4 = '%(hostname)s.%(zone)s'
-
-# DEPRECATED: format which replaced by formatv4/formatv6 (multi valued)
-# This option is deprecated for removal.
-# Its value may be silently ignored in the future.
-# Reason: Replaced by 'formatv4/formatv6'
-#format =
-
-# IPv6 format (multi valued)
-#formatv6 =
-formatv6 = '%(hostname)s.%(zone)s'
-
-
-[handler:nova_fixed]
-
-#
-# From designate.opts
-#
-
-# notification any events from nova (list value)
-#notification_topics = notifications
-
-# control-exchange for nova notification (string value)
-#control_exchange = nova
-
-# Zone ID with each notification (string value)
-#zone_id = <None>
-zone_id = {{ server.domain_id }}
-
-# IPv4 format (multi valued)
-#formatv4 =
-
-# DEPRECATED: format which replaced by formatv4/formatv6 (multi valued)
-# This option is deprecated for removal.
-# Its value may be silently ignored in the future.
-# Reason: Replaced by 'formatv4/formatv6'
-#format =
-formatv4 = '%(hostname)s.%(zone)s'
-
-# IPv6 format (multi valued)
-#formatv6 =
-formatv6 = '%(hostname)s.%(zone)s'
-
+{% include "designate/files/" + server.version|string + "/notification_handlers/_" + name + ".conf" %}
+{%- endfor %}
[healthcheck]
{%- if server.healthcheck is defined %}
@@ -758,7 +704,6 @@
# Enabled Notification Handlers (list value)
#enabled_notification_handlers =
-enabled_notification_handlers = nova_fixed,neutron_floatingip
# Maximum zone name length (integer value)
#max_zone_name_len = 255
@@ -980,6 +925,15 @@
# Enabled Notification Handlers (list value)
#enabled_notification_handlers =
+{%- set handlers = [] %}
+{%- for name, handler in server.notification_handlers.iteritems() %}
+ {%- if handler.get('enabled', False) %}
+ {%- do handlers.append(name) %}
+ {%- endif %}
+{%- endfor %}
+{%- if handlers %}
+enabled_notification_handlers = {{ handlers|sort|join(', ') }}
+{%- endif %}
# pool name to use for oslo.messaging notification listener. Note that listener
# pooling is not supported by all oslo.messaging drivers. (string value)
diff --git a/designate/files/queens/notification_handlers/_neutron_floatingip.conf b/designate/files/queens/notification_handlers/_neutron_floatingip.conf
new file mode 100644
index 0000000..eb6927f
--- /dev/null
+++ b/designate/files/queens/notification_handlers/_neutron_floatingip.conf
@@ -0,0 +1,35 @@
+[handler:neutron_floatingip]
+
+#
+# From designate.opts
+#
+
+# notification any events from neutron (list value)
+#notification_topics = notifications
+{%- if _data.notification_topics is defined %}
+notification_topics = {{ _data.notification_topics }}
+{%- endif %}
+
+# control-exchange for neutron notification (string value)
+#control_exchange = neutron
+{%- if _data.control_exchange is defined %}
+control_exchange = {{ _data.control_exchange }}
+{%- endif %}
+
+# Zone ID with each notification (string value)
+#zone_id = <None>
+{%- if _data.zone_id is defined %}
+zone_id = {{ _data.zone_id }}
+{%- endif %}
+
+# IPv4 format (multi valued)
+#formatv4 =
+{%- if _data.formatv4 is defined %}
+formatv4 = {{ _data.formatv4 | yaml_squote }}
+{%- endif %}
+
+# IPv6 format (multi valued)
+#formatv6 =
+{%- if _data.formatv6 is defined %}
+formatv6 = {{ _data.formatv6 | yaml_squote }}
+{%- endif %}
\ No newline at end of file
diff --git a/designate/files/queens/notification_handlers/_nova_fixed.conf b/designate/files/queens/notification_handlers/_nova_fixed.conf
new file mode 100644
index 0000000..6a4b4b1
--- /dev/null
+++ b/designate/files/queens/notification_handlers/_nova_fixed.conf
@@ -0,0 +1,35 @@
+[handler:nova_fixed]
+
+#
+# From designate.opts
+#
+
+# notification any events from nova (list value)
+#notification_topics = notifications
+{%- if _data.notification_topics is defined %}
+notification_topics = {{ _data.notification_topics }}
+{%- endif %}
+
+# control-exchange for nova notification (string value)
+#control_exchange = nova
+{%- if _data.control_exchange is defined %}
+control_exchange = {{ _data.control_exchange }}
+{%- endif %}
+
+# Zone ID with each notification (string value)
+#zone_id = <None>
+{%- if _data.zone_id is defined %}
+zone_id = {{ _data.zone_id }}
+{%- endif %}
+
+# IPv4 format (multi valued)
+#formatv4 =
+{%- if _data.formatv4 is defined %}
+formatv4 = {{ _data.formatv4 | yaml_squote }}
+{%- endif %}
+
+# IPv6 format (multi valued)
+#formatv6 =
+{%- if _data.formatv6 is defined %}
+formatv6 = {{ _data.formatv6 | yaml_squote }}
+{%- endif %}
\ No newline at end of file
diff --git a/designate/map.jinja b/designate/map.jinja
index 74f0f59..e103006 100644
--- a/designate/map.jinja
+++ b/designate/map.jinja
@@ -15,6 +15,17 @@
'pkgs': ['designate-api', 'designate-central', 'designate-sink'],
'services': ['designate-api', 'designate-central', 'designate-sink'],
'cacert_file': '/etc/ssl/certs/ca-certificates.crt',
+ 'notification_handlers': {
+ 'nova_fixed': {
+ 'enabled': true,
+ 'formatv4': '%(hostname)s.%(zone)s',
+ 'formatv6': '%(hostname)s.%(zone)s'
+ },
+ 'neutron_floatingip': {
+ 'enabled': true,
+ 'formatv4': '%(octet0)s-%(octet1)s-%(octet2)s-%(octet3)s.%(zone)s',
+ }
+ },
'logging': {
'app_name': 'designate',
'log_appender': false,
@@ -29,6 +40,19 @@
'pkgs': ['openstack-designate-api', 'openstack-designate-central', 'openstack-designate-sink'],
'services': ['designate-api', 'designate-central', 'designate-sink'],
'cacert_file': '/etc/pki/tls/certs/ca-bundle.crt',
+ 'notification_handlers': {
+ 'nova_fixed': {
+ 'enabled': true,
+ 'control_exchange': 'nova',
+ 'formatv4': '%(hostname)s.%(zone)s',
+ 'formatv6': '%(hostname)s.%(zone)s'
+ },
+ 'neutron_floatingip': {
+ 'enabled': true,
+ 'control_exchange': 'neutron',
+ 'formatv4': '%(octet0)s-%(octet1)s-%(octet2)s-%(octet3)s.%(zone)s',
+ }
+ },
'logging': {
'app_name': 'designate',
'log_appender': false,
diff --git a/designate/pool_manager.sls b/designate/pool_manager.sls
index 6c293df..9e8fce6 100644
--- a/designate/pool_manager.sls
+++ b/designate/pool_manager.sls
@@ -9,6 +9,9 @@
service.running:
- enable: true
- names: {{ pool_manager.services }}
+ {%- if grains.get('noservices') %}
+ - onlyif: /bin/false
+ {%- endif %}
- watch:
- file: /etc/designate/designate.conf
{%- endif %}
diff --git a/designate/worker.sls b/designate/worker.sls
index b1f52b6..dcadd1a 100644
--- a/designate/worker.sls
+++ b/designate/worker.sls
@@ -9,6 +9,9 @@
service.running:
- enable: true
- names: {{ worker.services }}
+ {%- if grains.get('noservices') %}
+ - onlyif: /bin/false
+ {%- endif %}
- watch:
- file: /etc/designate/designate.conf
diff --git a/tests/integration/ocata/server_cluster/config_spec.rb b/tests/integration/ocata/server_cluster/config_spec.rb
new file mode 100644
index 0000000..9330b40
--- /dev/null
+++ b/tests/integration/ocata/server_cluster/config_spec.rb
@@ -0,0 +1,63 @@
+ssl_enabled = attribute("ssl", default: false)
+
+oslo_messaging_rabbit = {
+ 'rabbit_hosts' => '127.0.0.1:5672,127.0.0.2:5672,127.0.0.3:5672'
+}
+
+service_sink = {
+ 'enabled_notification_handlers' => 'nova_fixed, neutron_floatingip'
+}
+
+handler_nova_fixed = {
+ 'zone_id' => '5186883b-91fb-4891-bd49-e6769234a8fc',
+ 'notification_topics' => 'notifications',
+ 'control_exchange' => "'nova'",
+ 'formatv4' => "'%(hostname)s.%(zone)s'",
+ 'formatv6' => "'%(hostname)s.%(zone)s'",
+}
+
+handler_neutron_floatingip = {
+ 'zone_id' => '5186883b-91fb-4891-bd49-e6769234a8fc',
+ 'notification_topics' => 'notifications',
+ 'control_exchange' => "'neutron'",
+ 'formatv4' => "'%(hostname)s.%(zone)s'",
+ 'formatv6' => "'%(hostname)s.%(zone)s'",
+}
+
+control 'Designate' do
+
+ describe parse_config_file('/etc/designate/designate.conf') do
+
+ describe 'Designate messaging' do
+
+ if ssl_enabled
+ # SSL not supported in Ocata
+ describe 'SSL' do
+ end
+ else
+ describe 'non SSL' do
+ its('oslo_messaging_rabbit') do
+ should include(oslo_messaging_rabbit)
+ end
+ end
+ end
+
+ end
+
+ describe 'Designate notification handlers' do
+
+ its('service:sink') do
+ should include(service_sink)
+ end
+
+ its('handler:nova_fixed') do
+ should include(handler_nova_fixed)
+ end
+
+ its('handler:neutron_floatingip') do
+ should include(handler_neutron_floatingip)
+ end
+
+ end
+ end
+end
\ No newline at end of file
diff --git a/tests/integration/ocata/server_single/config_spec.rb b/tests/integration/ocata/server_single/config_spec.rb
new file mode 100644
index 0000000..6ffe944
--- /dev/null
+++ b/tests/integration/ocata/server_single/config_spec.rb
@@ -0,0 +1,65 @@
+ssl_enabled = attribute("ssl", default: false)
+
+oslo_messaging_rabbit = {
+ 'rabbit_host' => '127.0.0.1',
+ 'rabbit_port' => '5672'
+}
+
+service_sink = {
+ 'enabled_notification_handlers' => 'nova_fixed, neutron_floatingip'
+}
+
+handler_nova_fixed = {
+ 'zone_id' => '5186883b-91fb-4891-bd49-e6769234a8fc',
+ 'notification_topics' => 'notifications',
+ 'control_exchange' => "'nova'",
+ 'formatv4' => "'%(hostname)s.%(zone)s'",
+ 'formatv6' => "'%(hostname)s.%(zone)s'",
+}
+
+handler_neutron_floatingip = {
+ 'zone_id' => '5186883b-91fb-4891-bd49-e6769234a8fc',
+ 'notification_topics' => 'notifications',
+ 'control_exchange' => "'neutron'",
+ 'formatv4' => "'%(hostname)s.%(zone)s'",
+ 'formatv6' => "'%(hostname)s.%(zone)s'",
+}
+
+control 'Designate' do
+
+ describe parse_config_file('/etc/designate/designate.conf') do
+
+ describe 'Designate messaging' do
+
+ if ssl_enabled
+ # SSL not supported in Ocata
+ describe 'SSL' do
+ end
+ else
+ describe 'non SSL' do
+ its('oslo_messaging_rabbit') do
+ should include(oslo_messaging_rabbit)
+ end
+ end
+ end
+
+ end
+
+ describe 'Designate notification handlers' do
+
+ its('service:sink') do
+ should include(service_sink)
+ end
+
+ its('handler:nova_fixed') do
+ should include(handler_nova_fixed)
+ end
+
+ its('handler:neutron_floatingip') do
+ should include(handler_neutron_floatingip)
+ end
+
+ end
+
+ end
+end
\ No newline at end of file
diff --git a/tests/integration/pike/server_cluster/config_spec.rb b/tests/integration/pike/server_cluster/config_spec.rb
new file mode 100644
index 0000000..870ac21
--- /dev/null
+++ b/tests/integration/pike/server_cluster/config_spec.rb
@@ -0,0 +1,73 @@
+ssl_enabled = attribute("ssl", default: false)
+
+oslo_messaging_rabbit_ssl = {
+ 'rabbit_hosts' => '127.0.0.1:5671,127.0.0.2:5671,127.0.0.3:5671',
+ 'rabbit_use_ssl' => 'true',
+ 'kombu_ssl_version' => 'TLSv1_2',
+ 'kombu_ssl_ca_certs' => '/etc/designate/ssl/mysql/ca-cert.pem',
+}
+
+oslo_messaging_rabbit = {
+ 'rabbit_hosts' => '127.0.0.1:5672,127.0.0.2:5672,127.0.0.3:5672'
+}
+
+service_sink = {
+ 'enabled_notification_handlers' => 'nova_fixed, neutron_floatingip'
+}
+
+handler_nova_fixed = {
+ 'zone_id' => '5186883b-91fb-4891-bd49-e6769234a8fc',
+ 'notification_topics' => 'notifications',
+ 'control_exchange' => "'nova'",
+ 'formatv4' => "'%(hostname)s.%(zone)s'",
+ 'formatv6' => "'%(hostname)s.%(zone)s'",
+}
+
+handler_neutron_floatingip = {
+ 'zone_id' => '5186883b-91fb-4891-bd49-e6769234a8fc',
+ 'notification_topics' => 'notifications',
+ 'control_exchange' => "'neutron'",
+ 'formatv4' => "'%(hostname)s.%(zone)s'",
+ 'formatv6' => "'%(hostname)s.%(zone)s'",
+}
+
+control 'Designate' do
+
+ describe parse_config_file('/etc/designate/designate.conf') do
+
+ describe 'Designate messaging' do
+
+ if ssl_enabled
+ oslo_messaging_rabbit.merge!(oslo_messaging_rabbit_ssl)
+ describe 'SSL' do
+ its('oslo_messaging_rabbit') {
+ should include(oslo_messaging_rabbit)
+ }
+ end
+ else
+ describe 'non SSL' do
+ its('oslo_messaging_rabbit') do
+ should include(oslo_messaging_rabbit)
+ end
+ end
+ end
+
+ end
+
+ describe 'Designate notification handlers' do
+
+ its('service:sink') do
+ should include(service_sink)
+ end
+
+ its('handler:nova_fixed') do
+ should include(handler_nova_fixed)
+ end
+
+ its('handler:neutron_floatingip') do
+ should include(handler_neutron_floatingip)
+ end
+
+ end
+ end
+end
\ No newline at end of file
diff --git a/tests/integration/pike/server_single/config_spec.rb b/tests/integration/pike/server_single/config_spec.rb
new file mode 100644
index 0000000..c872c61
--- /dev/null
+++ b/tests/integration/pike/server_single/config_spec.rb
@@ -0,0 +1,73 @@
+ssl_enabled = attribute("ssl", default: false)
+
+oslo_messaging_rabbit = {
+ 'rabbit_host' => '127.0.0.1',
+ 'rabbit_port' => '5672'
+}
+oslo_messaging_rabbit_ssl = {
+ 'rabbit_port' => '5671',
+ 'rabbit_use_ssl' => 'true',
+ 'kombu_ssl_version' => 'TLSv1_2',
+ 'kombu_ssl_ca_certs' => '/etc/designate/ssl/mysql/ca-cert.pem',
+}
+
+service_sink = {
+ 'enabled_notification_handlers' => 'nova_fixed, neutron_floatingip'
+}
+
+handler_nova_fixed = {
+ 'zone_id' => '5186883b-91fb-4891-bd49-e6769234a8fc',
+ 'notification_topics' => 'notifications',
+ 'control_exchange' => "'nova'",
+ 'formatv4' => "'%(hostname)s.%(zone)s'",
+ 'formatv6' => "'%(hostname)s.%(zone)s'",
+}
+
+handler_neutron_floatingip = {
+ 'zone_id' => '5186883b-91fb-4891-bd49-e6769234a8fc',
+ 'notification_topics' => 'notifications',
+ 'control_exchange' => "'neutron'",
+ 'formatv4' => "'%(hostname)s.%(zone)s'",
+ 'formatv6' => "'%(hostname)s.%(zone)s'",
+}
+
+control 'Designate' do
+
+ describe parse_config_file('/etc/designate/designate.conf') do
+
+ describe 'Designate messaging' do
+
+ if ssl_enabled
+ oslo_messaging_rabbit.merge!(oslo_messaging_rabbit_ssl)
+ describe 'SSL' do
+ its('oslo_messaging_rabbit') {
+ should include(oslo_messaging_rabbit)
+ }
+ end
+ else
+ describe 'non SSL' do
+ its('oslo_messaging_rabbit') do
+ should include(oslo_messaging_rabbit)
+ end
+ end
+ end
+
+ end
+
+ describe 'Designate notification handlers' do
+
+ its('service:sink') do
+ should include(service_sink)
+ end
+
+ its('handler:nova_fixed') do
+ should include(handler_nova_fixed)
+ end
+
+ its('handler:neutron_floatingip') do
+ should include(handler_neutron_floatingip)
+ end
+
+ end
+ end
+end
\ No newline at end of file
diff --git a/tests/integration/queens/server_cluster/config_spec.rb b/tests/integration/queens/server_cluster/config_spec.rb
new file mode 100644
index 0000000..6c5a738
--- /dev/null
+++ b/tests/integration/queens/server_cluster/config_spec.rb
@@ -0,0 +1,77 @@
+ssl_enabled = attribute("ssl", default: false)
+
+oslo_messaging_default_ssl = {
+ 'transport_url' => 'rabbit://openstack:password@127.0.0.1:5671,openstack:password@127.0.0.2:5671,openstack:password@127.0.0.3:5671//openstack'
+}
+
+oslo_messaging_rabbit_ssl = {
+ 'ssl' => 'true',
+ 'ssl_version' => 'TLSv1_2',
+ 'ssl_ca_file' => '/etc/designate/ssl/mysql/ca-cert.pem',
+}
+
+oslo_messaging_default = {
+ 'transport_url' => 'rabbit://openstack:password@127.0.0.1:5672,openstack:password@127.0.0.2:5672,openstack:password@127.0.0.3:5672//openstack'
+}
+
+oslo_messaging_rabbit = {}
+
+service_sink = {
+ 'enabled_notification_handlers' => 'neutron_floatingip, nova_fixed'
+}
+
+handler_nova_fixed = {
+ 'zone_id' => '5186883b-91fb-4891-bd49-e6769234a8fc',
+ 'formatv4' => "'%(hostname)s.%(zone)s'",
+ 'formatv6' => "'%(hostname)s.%(zone)s'",
+}
+
+handler_neutron_floatingip = {
+ 'zone_id' => '5186883b-91fb-4891-bd49-e6769234a8fc',
+ 'formatv4' => "'%(octet0)s-%(octet1)s-%(octet2)s-%(octet3)s.%(zone)s'",
+}
+
+control 'Designate' do
+
+ describe parse_config_file('/etc/designate/designate.conf') do
+
+ describe 'Designate messaging' do
+
+ if ssl_enabled
+ oslo_messaging_default.merge!(oslo_messaging_default_ssl)
+ oslo_messaging_rabbit.merge!(oslo_messaging_rabbit_ssl)
+ describe 'SSL' do
+ its('DEFAULT') {
+ should include(oslo_messaging_default)
+ }
+ its('oslo_messaging_rabbit') {
+ should include(oslo_messaging_rabbit)
+ }
+ end
+ else
+ describe 'non SSL' do
+ its('DEFAULT') do
+ should include(oslo_messaging_default)
+ end
+ end
+ end
+
+ end
+
+ describe 'Designate notification handlers' do
+
+ its('service:sink') do
+ should include(service_sink)
+ end
+
+ its('handler:nova_fixed') do
+ should include(handler_nova_fixed)
+ end
+
+ its('handler:neutron_floatingip') do
+ should include(handler_neutron_floatingip)
+ end
+
+ end
+ end
+end
\ No newline at end of file
diff --git a/tests/integration/queens/server_single/config_spec.rb b/tests/integration/queens/server_single/config_spec.rb
new file mode 100644
index 0000000..ee8ca13
--- /dev/null
+++ b/tests/integration/queens/server_single/config_spec.rb
@@ -0,0 +1,77 @@
+ssl_enabled = attribute("ssl", default: false)
+
+oslo_messaging_default_ssl = {
+ 'transport_url' => 'rabbit://openstack:password@127.0.0.1:5671//openstack'
+}
+
+oslo_messaging_rabbit_ssl = {
+ 'ssl' => 'true',
+ 'ssl_version' => 'TLSv1_2',
+ 'ssl_ca_file' => '/etc/designate/ssl/mysql/ca-cert.pem',
+}
+
+oslo_messaging_default = {
+ 'transport_url' => 'rabbit://openstack:password@127.0.0.1:5672//openstack'
+}
+
+oslo_messaging_rabbit = {}
+
+service_sink = {
+ 'enabled_notification_handlers' => 'neutron_floatingip, nova_fixed'
+}
+
+handler_nova_fixed = {
+ 'zone_id' => '5186883b-91fb-4891-bd49-e6769234a8fc',
+ 'formatv4' => "'%(hostname)s.%(zone)s'",
+ 'formatv6' => "'%(hostname)s.%(zone)s'",
+}
+
+handler_neutron_floatingip = {
+ 'zone_id' => '5186883b-91fb-4891-bd49-e6769234a8fc',
+ 'formatv4' => "'%(octet0)s-%(octet1)s-%(octet2)s-%(octet3)s.%(zone)s'",
+}
+
+control 'Designate' do
+
+ describe parse_config_file('/etc/designate/designate.conf') do
+
+ describe 'Designate messaging' do
+
+ if ssl_enabled
+ oslo_messaging_default.merge!(oslo_messaging_default_ssl)
+ oslo_messaging_rabbit.merge!(oslo_messaging_rabbit_ssl)
+ describe 'SSL' do
+ its('DEFAULT') {
+ should include(oslo_messaging_default)
+ }
+ its('oslo_messaging_rabbit') {
+ should include(oslo_messaging_rabbit)
+ }
+ end
+ else
+ describe 'non SSL' do
+ its('DEFAULT') do
+ should include(oslo_messaging_default)
+ end
+ end
+ end
+
+ end
+
+ describe 'Designate notification handlers' do
+
+ its('service:sink') do
+ should include(service_sink)
+ end
+
+ its('handler:nova_fixed') do
+ should include(handler_nova_fixed)
+ end
+
+ its('handler:neutron_floatingip') do
+ should include(handler_neutron_floatingip)
+ end
+
+ end
+ end
+end
\ No newline at end of file
diff --git a/tests/pillar/designate_liberty.sls b/tests/pillar/designate_liberty.sls
deleted file mode 100644
index d43dee8..0000000
--- a/tests/pillar/designate_liberty.sls
+++ /dev/null
@@ -1,65 +0,0 @@
-designate:
- pool_manager:
- enabled: true
- server:
- enabled: true
- bind:
- api:
- address: 127.0.0.1
- region: RegionOne
- domain_id: 5186883b-91fb-4891-bd49-e6769234a8fc
- version: liberty
- mdns:
- address: 0.0.0.0
- port: 5354
- admin_api:
- enabled: true
- enabled_extensions_admin: quotas
- database:
- engine: mysql
- host: 127.0.0.1
- port: 3306
- name:
- main_database: designate
- pool_manager: designate_pool_manager
- user: designate
- password: passw0rd
- message_queue:
- engine: rabbitmq
- members:
- - host: 127.0.0.1
- - host: 127.0.1.1
- - host: 127.0.2.1
- user: openstack
- password: password
- virtual_host: '/openstack'
- identity:
- host: 127.0.0.1
- port: 35357
- user: designate
- logging:
- log_appender: false
- log_handlers:
- watchedfile:
- enabled: true
- fluentd:
- enabled: false
- ossyslog:
- enabled: false
- pool:
- pool_id: cae73b6f-95eb-4a7d-a567-099ae6176e08
- nameservers:
- - uuid: 690d7bc8-811b-404c-abcc-9cec54d87092
- host: 127.0.0.1
- port: 53
- - uuid: bc5ddcf0-8d95-4f87-b435-9ff831a4a14c
- host: 127.0.1.1
- port: 53
- - uuid: a43d5375-a5ec-4077-8c87-ec0b08fa3bd1
- host: 127.0.2.1
- port: 53
- targets:
- uuid: f26e0b32-736f-4f0a-831b-039a415c481e
- options: 'port: 53, host: 127.0.0.1'
- masters: 127.0.0.1:5354
- type: bind9
diff --git a/tests/pillar/designate_ocata.sls b/tests/pillar/designate_ocata.sls
deleted file mode 100644
index 93e7e7a..0000000
--- a/tests/pillar/designate_ocata.sls
+++ /dev/null
@@ -1,169 +0,0 @@
-designate:
- _support:
- sensu:
- enabled: false
- server:
- enabled: true
- region: RegionOne
- domain_id: 5186883b-91fb-4891-bd49-e6769234a8fc
- version: ocata
- api:
- quotas_verify_project_id: false
- bind:
- api:
- address: 127.0.0.1
- admin_api:
- enabled: true
- enabled_extensions_admin: quotas
- database:
- engine: mysql
- host: 127.0.0.1
- port: 3306
- name:
- main_database: designate
- pool_manager: designate_pool_manager
- user: designate
- password: passw0rd
- identity:
- engine: keystone
- host: 127.0.0.1
- port: 35357
- tenant: service
- user: designate
- password: passw0rd
- mdns:
- address: 0.0.0.0
- port: 5354
- message_queue:
- engine: rabbitmq
- members:
- - host: 127.0.0.1
- user: openstack
- password: password
- virtual_host: '/openstack'
- logging:
- log_appender: false
- log_handlers:
- watchedfile:
- enabled: true
- fluentd:
- enabled: false
- ossyslog:
- enabled: false
- pools:
- default:
- description: 'default pool'
- attributes:
- service_tier: GOLD
- test_attr: test_value
- ns_records:
- - hostname: 'ns1.example.org.'
- priority: 10
- nameservers:
- - host: 127.0.0.1
- port: 53
- - host: 127.0.1.1
- port: 53
- - host: 127.0.2.1
- port: 53
- targets:
- default_target:
- type: bind9
- description: 'default target'
- masters:
- - host: 127.0.0.1
- port: 5354
- options:
- host: 127.0.0.1
- port: 53
- rndc_host: 127.0.0.1
- rndc_port: 953
- rndc_key_file: /etc/designate/rndc.key
- also_notifies:
- - host: 127.0.3.1
- port: 53
- quota:
- zones: 40
- worker:
- enabled: true
- logging:
- log_appender: false
- log_handlers:
- watchedfile:
- enabled: true
- fluentd:
- enabled: false
- ossyslog:
- enabled: false
-mysql:
- client:
- enabled: true
- version: '5.7'
- admin:
- host: localhost
- port: 3306
- user: admin
- password: password
- encoding: utf8
- server:
- enabled: true
- version: "5.7"
- force_encoding: utf8
- bind:
- address: 0.0.0.0
- port: 3306
- protocol: tcp
- database:
- designate:
- encoding: utf8
- users:
- - host: '%'
- name: designate
- password: passw0rd
- rights: all
- - host: 127.0.0.1
- name: designate
- password: passw0rd
- rights: all
- designate_pool_manager:
- encoding: utf8
- users:
- - host: '%'
- name: designate
- password: passw0rd
- rights: all
- - host: 127.0.0.1
- name: designate
- password: passw0rd
- rights: all
-# On xenial rabbitmq fails to start inside docker on MK CI
-# rabbitmq:
-# server:
-# enabled: true
-# bind:
-# address: 0.0.0.0
-# port: 5672
-# secret_key: rabbit_master_cookie
-# admin:
-# name: adminuser
-# password: pwd
-# host:
-# '/':
-# enabled: true
-# user: guest
-# password: guest
-# policies:
-# - name: HA
-# pattern: '^(?!amq\.).*'
-# definition: '{"ha-mode": "all", "message-ttl": 120000}'
-# '/openstack':
-# enabled: true
-# user: openstack
-# password: password
-# policies:
-# - name: HA
-# pattern: '^(?!amq\.).*'
-# definition: '{"ha-mode": "all", "message-ttl": 120000}'
-# memory:
-# vm_high_watermark: 0.4
-# plugins: ['']
diff --git a/tests/pillar/repo_mcp_openstack.sls b/tests/pillar/repo_mcp_openstack_ocata.sls
similarity index 100%
rename from tests/pillar/repo_mcp_openstack.sls
rename to tests/pillar/repo_mcp_openstack_ocata.sls
diff --git a/tests/pillar/repo_mcp_openstack_pike.sls b/tests/pillar/repo_mcp_openstack_pike.sls
new file mode 100644
index 0000000..789b907
--- /dev/null
+++ b/tests/pillar/repo_mcp_openstack_pike.sls
@@ -0,0 +1,12 @@
+linux:
+ system:
+ enabled: true
+ repo:
+ mirantis_openstack_repo:
+ source: "deb http://mirror.fuel-infra.org/mcp-repos/pike/{{ grains.get('oscodename') }} pike main"
+ architectures: amd64
+ key_url: "http://mirror.fuel-infra.org/mcp-repos/pike/{{ grains.get('oscodename') }}/archive-mcppike.key"
+ pin:
+ - pin: 'release a=pike'
+ priority: 1050
+ package: '*'
\ No newline at end of file
diff --git a/tests/pillar/repo_mcp_openstack_queens.sls b/tests/pillar/repo_mcp_openstack_queens.sls
new file mode 100644
index 0000000..a8c7e77
--- /dev/null
+++ b/tests/pillar/repo_mcp_openstack_queens.sls
@@ -0,0 +1,12 @@
+linux:
+ system:
+ enabled: true
+ repo:
+ mirantis_openstack_repo:
+ source: "deb http://mirror.mirantis.com/nightly/openstack-queens/{{ grains.get('oscodename') }} {{ grains.get('oscodename') }} main"
+ architectures: amd64
+ key_url: "http://mirror.mirantis.com/nightly/openstack-queens/{{ grains.get('oscodename') }}/archive-queens.key"
+ pin:
+ - pin: 'release l=queens'
+ priority: 1050
+ package: '*'
\ No newline at end of file
diff --git a/tests/pillar/server_cluster.sls b/tests/pillar/server_cluster.sls
new file mode 100644
index 0000000..2313ef7
--- /dev/null
+++ b/tests/pillar/server_cluster.sls
@@ -0,0 +1,99 @@
+designate:
+ _support:
+ sensu:
+ enabled: false
+ server:
+ enabled: true
+ region: RegionOne
+ domain_id: 5186883b-91fb-4891-bd49-e6769234a8fc
+ version: ocata
+ api:
+ quotas_verify_project_id: false
+ bind:
+ api:
+ address: 127.0.0.1
+ admin_api:
+ enabled: true
+ enabled_extensions_admin: quotas
+ database:
+ engine: mysql
+ host: 127.0.0.1
+ port: 3306
+ name:
+ main_database: designate
+ pool_manager: designate_pool_manager
+ user: designate
+ password: passw0rd
+ identity:
+ engine: keystone
+ host: 127.0.0.1
+ port: 35357
+ tenant: service
+ user: designate
+ password: passw0rd
+ mdns:
+ address: 0.0.0.0
+ port: 5354
+ message_queue:
+ engine: rabbitmq
+ members:
+ - host: 127.0.0.1
+ - host: 127.0.0.2
+ - host: 127.0.0.3
+ user: openstack
+ password: password
+ virtual_host: '/openstack'
+ logging:
+ log_appender: false
+ log_handlers:
+ watchedfile:
+ enabled: true
+ fluentd:
+ enabled: false
+ ossyslog:
+ enabled: false
+ pools:
+ default:
+ description: 'default pool'
+ attributes:
+ service_tier: GOLD
+ test_attr: test_value
+ ns_records:
+ - hostname: 'ns1.example.org.'
+ priority: 10
+ nameservers:
+ - host: 127.0.0.1
+ port: 53
+ - host: 127.0.1.1
+ port: 53
+ - host: 127.0.2.1
+ port: 53
+ targets:
+ default_target:
+ type: bind9
+ description: 'default target'
+ masters:
+ - host: 127.0.0.1
+ port: 5354
+ options:
+ host: 127.0.0.1
+ port: 53
+ rndc_host: 127.0.0.1
+ rndc_port: 953
+ rndc_key_file: /etc/designate/rndc.key
+ also_notifies:
+ - host: 127.0.3.1
+ port: 53
+ quota:
+ zones: 40
+ worker:
+ enabled: true
+ logging:
+ log_appender: false
+ log_handlers:
+ watchedfile:
+ enabled: true
+ fluentd:
+ enabled: false
+ ossyslog:
+ enabled: false
\ No newline at end of file
diff --git a/tests/pillar/server_single.sls b/tests/pillar/server_single.sls
new file mode 100644
index 0000000..ea81a3b
--- /dev/null
+++ b/tests/pillar/server_single.sls
@@ -0,0 +1,97 @@
+designate:
+ _support:
+ sensu:
+ enabled: false
+ server:
+ enabled: true
+ region: RegionOne
+ domain_id: 5186883b-91fb-4891-bd49-e6769234a8fc
+ version: ocata
+ api:
+ quotas_verify_project_id: false
+ bind:
+ api:
+ address: 127.0.0.1
+ admin_api:
+ enabled: true
+ enabled_extensions_admin: quotas
+ database:
+ engine: mysql
+ host: 127.0.0.1
+ port: 3306
+ name:
+ main_database: designate
+ pool_manager: designate_pool_manager
+ user: designate
+ password: passw0rd
+ identity:
+ engine: keystone
+ host: 127.0.0.1
+ port: 35357
+ tenant: service
+ user: designate
+ password: passw0rd
+ mdns:
+ address: 0.0.0.0
+ port: 5354
+ message_queue:
+ engine: rabbitmq
+ host: 127.0.0.1
+ port: 5672
+ user: openstack
+ password: password
+ virtual_host: '/openstack'
+ logging:
+ log_appender: false
+ log_handlers:
+ watchedfile:
+ enabled: true
+ fluentd:
+ enabled: false
+ ossyslog:
+ enabled: false
+ pools:
+ default:
+ description: 'default pool'
+ attributes:
+ service_tier: GOLD
+ test_attr: test_value
+ ns_records:
+ - hostname: 'ns1.example.org.'
+ priority: 10
+ nameservers:
+ - host: 127.0.0.1
+ port: 53
+ - host: 127.0.1.1
+ port: 53
+ - host: 127.0.2.1
+ port: 53
+ targets:
+ default_target:
+ type: bind9
+ description: 'default target'
+ masters:
+ - host: 127.0.0.1
+ port: 5354
+ options:
+ host: 127.0.0.1
+ port: 53
+ rndc_host: 127.0.0.1
+ rndc_port: 953
+ rndc_key_file: /etc/designate/rndc.key
+ also_notifies:
+ - host: 127.0.3.1
+ port: 53
+ quota:
+ zones: 40
+ worker:
+ enabled: true
+ logging:
+ log_appender: false
+ log_handlers:
+ watchedfile:
+ enabled: true
+ fluentd:
+ enabled: false
+ ossyslog:
+ enabled: false
\ No newline at end of file
diff --git a/tests/pillar/ssl.sls b/tests/pillar/ssl.sls
deleted file mode 100644
index 7168c35..0000000
--- a/tests/pillar/ssl.sls
+++ /dev/null
@@ -1,12 +0,0 @@
-include:
- - .designate_ocata
-
-designate:
- server:
- database:
- ssl:
- enabled: True
- message_queue:
- port: 5671
- ssl:
- enabled: True