diff options
author | Kevin Benton <blak111@gmail.com> | 2014-09-20 00:17:58 -0700 |
---|---|---|
committer | Kevin Benton <blak111@gmail.com> | 2014-09-26 16:10:43 -0700 |
commit | 78a2ecb9923417f63c17c1e7055200ac97e6e947 (patch) | |
tree | ad1f045f8224a568e3a5d6c43e838f618c085861 | |
parent | e883880e15e57ed5f069f8e5e3d89ea710706ba4 (diff) | |
download | neutron-78a2ecb9923417f63c17c1e7055200ac97e6e947.tar.gz |
Fix broken port query in Extraroute test case
One of the queries in an extra route test case tries
to filter based on the port owner, but the _list_ports
method it calls doesn't take a device_owner parameter.
This can cause failures if a DHCP port is created on
the same subnet.
Change-Id: I0e62027ae4d98944ef91a5d457d43d4224441b2f
-rw-r--r-- | neutron/tests/unit/test_db_plugin.py | 8 | ||||
-rw-r--r-- | neutron/tests/unit/test_extension_extraroute.py | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/neutron/tests/unit/test_db_plugin.py b/neutron/tests/unit/test_db_plugin.py index 7754cc2b12..f6b8204886 100644 --- a/neutron/tests/unit/test_db_plugin.py +++ b/neutron/tests/unit/test_db_plugin.py @@ -368,10 +368,12 @@ class NeutronDbPluginV2TestCase(testlib_api.WebTestCase, def _list_ports(self, fmt, expected_res_status=None, net_id=None, **kwargs): - query_params = None + query_params = [] if net_id: - query_params = "network_id=%s" % net_id - port_req = self.new_list_request('ports', fmt, query_params) + query_params.append("network_id=%s" % net_id) + if kwargs.get('device_owner'): + query_params.append("device_owner=%s" % kwargs.get('device_owner')) + port_req = self.new_list_request('ports', fmt, '&'.join(query_params)) if ('set_context' in kwargs and kwargs['set_context'] is True and 'tenant_id' in kwargs): diff --git a/neutron/tests/unit/test_extension_extraroute.py b/neutron/tests/unit/test_extension_extraroute.py index f2fa6e3394..dad220370f 100644 --- a/neutron/tests/unit/test_extension_extraroute.py +++ b/neutron/tests/unit/test_extension_extraroute.py @@ -403,7 +403,7 @@ class ExtraRouteDBTestCaseBase(object): 200, s['subnet']['network_id'], tenant_id=r['router']['tenant_id'], - device_own=constants.DEVICE_OWNER_ROUTER_GW) + device_owner=constants.DEVICE_OWNER_ROUTER_GW) port_list = self.deserialize('json', port_res) self.assertEqual(len(port_list['ports']), 1) |