]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Allow ML2 plugin test cases to be run independently
authorHenry Gessau <gessau@cisco.com>
Fri, 25 Apr 2014 19:46:58 +0000 (15:46 -0400)
committerHenry Gessau <gessau@cisco.com>
Mon, 28 Apr 2014 19:45:13 +0000 (15:45 -0400)
Some test cases in neutron.tests.unit.ml2.test_ml2_plugin override the
network_vlan_ranges option in the ml2_type_vlan config group. However,
the test module does not import the ML2 type driver module where this
config group's options are registered. When unit tests are run by
tox/testr the module is imported during test discovery. Running the
tests independently via nose or testtools requires the option to be
explicitly imported.

Change-Id: I355a2d1212992eafed44f6d843c0fc9deb665df7
Closes-bug: #1287792

neutron/tests/unit/ml2/test_ml2_plugin.py

index 1abc600dfeae1105bd6284fa07fa3151e2ed275a..fd592a779279b807411478853565e683ee0a86a0 100644 (file)
@@ -36,6 +36,11 @@ from neutron.tests.unit import test_extension_extradhcpopts as test_dhcpopts
 from neutron.tests.unit import test_security_groups_rpc as test_sg_rpc
 
 
+config.cfg.CONF.import_opt('network_vlan_ranges',
+                           'neutron.plugins.ml2.drivers.type_vlan',
+                           group='ml2_type_vlan')
+
+
 PLUGIN_NAME = 'neutron.plugins.ml2.plugin.Ml2Plugin'