]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Modify a different agent in test_update_agent_description
authorHenry Gessau <gessau@cisco.com>
Fri, 27 Mar 2015 02:54:21 +0000 (22:54 -0400)
committerHenry Gessau <gessau@cisco.com>
Wed, 1 Apr 2015 02:40:00 +0000 (02:40 +0000)
API test_update_agent_description modifies an agent's description, and
test_list_agent assumes the first agent is never modified. We make
sure that an agent other than the first one is modified.

Closes-bug: 1437124

Change-Id: I7593e2896ab7ef8a14ad35005314382e65e805cb

neutron/tests/api/admin/test_agent_management.py

index a883c7be92efb62465007cba2bc7cdbb5a5c031f..013f3e44bbcc447d94794c0d82681b37e2c20ebb 100644 (file)
@@ -27,7 +27,8 @@ class AgentManagementTestJSON(base.BaseAdminNetworkTest):
             raise cls.skipException(msg)
         body = cls.admin_client.list_agents()
         agents = body['agents']
-        cls.agent = agents[0]
+        cls.agent = agents[0]  # don't modify this agent
+        cls.dyn_agent = agents[1]
 
     @test.attr(type='smoke')
     @test.idempotent_id('9c80f04d-11f3-44a4-8738-ed2f879b0ff4')
@@ -73,7 +74,7 @@ class AgentManagementTestJSON(base.BaseAdminNetworkTest):
         self.useFixture(fixtures.LockFixture('agent_description'))
         description = 'description for update agent.'
         agent_description = {'description': description}
-        body = self.admin_client.update_agent(agent_id=self.agent['id'],
+        body = self.admin_client.update_agent(agent_id=self.dyn_agent['id'],
                                               agent_info=agent_description)
         self.addCleanup(self._restore_agent)
         updated_description = body['agent']['description']