summaryrefslogtreecommitdiff
path: root/nova/tests/unit/conf
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2018-04-10 16:37:46 +0100
committerStephen Finucane <sfinucan@redhat.com>2018-07-24 15:33:49 +0100
commit9dfac2fda76a9bd7810d67f24e1b8ed5c16b549d (patch)
tree56b18595954304c7bfce41e45b66ced20786ecea /nova/tests/unit/conf
parent50713f9cb77ef87002ec67a7c7bf33cfe0318404 (diff)
downloadnova-9dfac2fda76a9bd7810d67f24e1b8ed5c16b549d.tar.gz
conf: Add '[neutron] physnets' and related options
Things are getting a little bit magic here. We don't want to store inventory in configuration and we _really_ don't want to do so with another JSON blob a la the various '[pci]' options. Placement is not yet at a stage where we can avoid the former but we can certainly avoid the latter. Do so through adding some static opts and some dynamic filter configuration, similarly to what Cinder does for backend configuration using its 'enabled_backends' configuration option. None of this is actually used yet - that will come later. Part of blueprint numa-aware-vswitches Change-Id: Id7c2f0b53c8871ff47a836ec4c324c8cce430b79
Diffstat (limited to 'nova/tests/unit/conf')
-rw-r--r--nova/tests/unit/conf/__init__.py0
-rw-r--r--nova/tests/unit/conf/test_neutron.py33
2 files changed, 33 insertions, 0 deletions
diff --git a/nova/tests/unit/conf/__init__.py b/nova/tests/unit/conf/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/nova/tests/unit/conf/__init__.py
diff --git a/nova/tests/unit/conf/test_neutron.py b/nova/tests/unit/conf/test_neutron.py
new file mode 100644
index 0000000000..b784486f9d
--- /dev/null
+++ b/nova/tests/unit/conf/test_neutron.py
@@ -0,0 +1,33 @@
+# Copyright 2018 Red Hat, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+import nova.conf
+from nova import test
+
+
+CONF = nova.conf.CONF
+
+
+class NeutronConfTestCase(test.NoDBTestCase):
+
+ def test_register_dynamic_opts(self):
+ self.flags(physnets=['foo', 'bar', 'baz'], group='neutron')
+
+ self.assertNotIn('neutron_physnet_foo', CONF)
+ self.assertNotIn('neutron_physnet_bar', CONF)
+
+ nova.conf.neutron.register_dynamic_opts(CONF)
+
+ self.assertIn('neutron_physnet_foo', CONF)
+ self.assertIn('neutron_physnet_bar', CONF)