diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-04-06 20:50:59 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-04-06 20:50:59 +0000 |
commit | 6c353f0843824bbdb6ae1f3f135f672fc18b1809 (patch) | |
tree | 5ccb344a3c05efcdaf70cba6d2c3a24f905e65d8 /tempest/api | |
parent | 57ae37951fff3ffe92167249656b9e5ec8231275 (diff) | |
parent | d80abe2750e307a0615810c5fbcdd614ba430151 (diff) | |
download | tempest-6c353f0843824bbdb6ae1f3f135f672fc18b1809.tar.gz |
Merge "L3 Agent Scheduler testcase cleanups"
Diffstat (limited to 'tempest/api')
-rw-r--r-- | tempest/api/network/admin/test_l3_agent_scheduler.py | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/tempest/api/network/admin/test_l3_agent_scheduler.py b/tempest/api/network/admin/test_l3_agent_scheduler.py index ad121b03a..cf0b5e32e 100644 --- a/tempest/api/network/admin/test_l3_agent_scheduler.py +++ b/tempest/api/network/admin/test_l3_agent_scheduler.py @@ -18,8 +18,16 @@ from tempest.api.network import base from tempest import exceptions from tempest import test +AGENT_TYPE = 'L3 agent' +AGENT_MODES = ( + 'legacy', + 'dvr_snat' +) + class L3AgentSchedulerTestJSON(base.BaseAdminNetworkTest): + _agent_mode = 'legacy' + """ Tests the following operations in the Neutron API using the REST client for Neutron: @@ -46,12 +54,17 @@ class L3AgentSchedulerTestJSON(base.BaseAdminNetworkTest): body = cls.admin_client.list_agents() agents = body['agents'] for agent in agents: - if agent['agent_type'] == 'L3 agent': + # TODO(armax): falling back on default _agent_mode can be + # dropped as soon as Icehouse is dropped. + agent_mode = ( + agent['configurations'].get('agent_mode', cls._agent_mode)) + if agent['agent_type'] == AGENT_TYPE and agent_mode in AGENT_MODES: cls.agent = agent break else: msg = "L3 Agent Scheduler enabled in conf, but L3 Agent not found" raise exceptions.InvalidConfiguration(msg) + cls.router = cls.create_router(data_utils.rand_name('router')) @test.attr(type='smoke') @test.idempotent_id('b7ce6e89-e837-4ded-9b78-9ed3c9c6a45a') @@ -62,22 +75,18 @@ class L3AgentSchedulerTestJSON(base.BaseAdminNetworkTest): @test.idempotent_id('9464e5e7-8625-49c3-8fd1-89c52be59d66') def test_add_list_remove_router_on_l3_agent(self): l3_agent_ids = list() - name = data_utils.rand_name('router1-') - router = self.client.create_router(name) - self.addCleanup(self.client.delete_router, router['router']['id']) self.admin_client.add_router_to_l3_agent( self.agent['id'], - router['router']['id']) - body = self.admin_client.list_l3_agents_hosting_router( - router['router']['id']) + self.router['id']) + body = ( + self.admin_client.list_l3_agents_hosting_router(self.router['id'])) for agent in body['agents']: l3_agent_ids.append(agent['id']) self.assertIn('agent_type', agent) self.assertEqual('L3 agent', agent['agent_type']) self.assertIn(self.agent['id'], l3_agent_ids) - del l3_agent_ids[:] body = self.admin_client.remove_router_from_l3_agent( self.agent['id'], - router['router']['id']) + self.router['id']) # NOTE(afazekas): The deletion not asserted, because neutron # is not forbidden to reschedule the router to the same agent |