Modify a different agent in test_update_agent_description

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
This commit is contained in:
Henry Gessau 2015-03-26 22:54:21 -04:00
parent 57a445d6c8
commit eb79e5fe53
1 changed files with 3 additions and 2 deletions

View 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']