Skip to content

Commit 4c842e8

Browse files
committed
Fix ipam_pluggable_backend unit tests module
This module couldn't be run alone due to missing registratration of the "ipam_driver" config option from the core neutron configuration. To solve that problem there is test plugin configured for those tests and it registers that option which is necessary. Change-Id: Iffdca967340c01d4e8c063c516d0d5441750c653 (cherry picked from commit a3e68e8)
1 parent 3a0e2ba commit 4c842e8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

neutron/tests/unit/db/test_ipam_pluggable_backend.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,11 @@ class TestIpamSubnetPool(UseIpamMixin, test_db_base.TestSubnetPoolsV2):
6363

6464

6565
class TestDbBasePluginIpam(test_db_base.NeutronDbPluginV2TestCase):
66-
def setUp(self):
66+
def setUp(self, plugin=None):
67+
if not plugin:
68+
plugin = 'neutron.tests.unit.db.test_ipam_backend_mixin.TestPlugin'
69+
super(TestDbBasePluginIpam, self).setUp(plugin=plugin)
6770
cfg.CONF.set_override("ipam_driver", 'internal')
68-
super(TestDbBasePluginIpam, self).setUp()
6971
self.tenant_id = uuidutils.generate_uuid()
7072
self.subnet_id = uuidutils.generate_uuid()
7173
self.admin_context = ncontext.get_admin_context()
@@ -413,7 +415,7 @@ def test_create_ipv6_pd_subnet_over_ipam(self, pool_mock):
413415
subnetpool_id=constants.IPV6_PD_POOL_ID,
414416
ipv6_ra_mode=constants.IPV6_SLAAC,
415417
ipv6_address_mode=constants.IPV6_SLAAC):
416-
self.assertEqual(2, pool_mock.get_instance.call_count)
418+
self.assertEqual(3, pool_mock.get_instance.call_count)
417419
self.assertTrue(mocks['driver'].allocate_subnet.called)
418420
request = mocks['driver'].allocate_subnet.call_args[0][0]
419421
self.assertIsInstance(request, ipam_req.SpecificSubnetRequest)

0 commit comments

Comments
 (0)