API test_update_agent_description modifies agent assumed unchanged by test_list_agent

Bug #1437124 reported by Henry Gessau
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Henry Gessau

Bug Description

API test_update_agent_description modifies the description of the agent identified by self.agent['id']. If that test case is run before test_list_agent, then the latter will fail because it compares with the original description:

2015-03-18 14:47:53.271 | 2015-03-18 14:47:53.237 |
2015-03-18 14:47:53.273 | 2015-03-18 14:47:53.239 | Captured traceback:
2015-03-18 14:47:53.275 | 2015-03-18 14:47:53.240 | ~~~~~~~~~~~~~~~~~~~
2015-03-18 14:47:53.275 | 2015-03-18 14:47:53.242 | Traceback (most recent call last):
2015-03-18 14:47:53.277 | 2015-03-18 14:47:53.243 | File "neutron/tests/tempest/api/network/admin/test_agent_management.py", line 43, in test_list_agent
2015-03-18 14:47:53.302 | 2015-03-18 14:47:53.244 | self.assertIn(self.agent, agents)
2015-03-18 14:47:53.303 | 2015-03-18 14:47:53.246 | File "/opt/stack/new/neutron/.tox/api/local/lib/python2.7/site-packages/testtools/testcase.py", line 356, in assertIn
2015-03-18 14:47:53.304 | 2015-03-18 14:47:53.251 | self.assertThat(haystack, Contains(needle), message)
2015-03-18 14:47:53.304 | 2015-03-18 14:47:53.254 | File "/opt/stack/new/neutron/.tox/api/local/lib/python2.7/site-packages/testtools/testcase.py", line 435, in assertThat
2015-03-18 14:47:53.305 | 2015-03-18 14:47:53.255 | raise mismatch_error
2015-03-18 14:47:53.306 | 2015-03-18 14:47:53.257 | testtools.matchers._impl.MismatchError: {u'alive': True, u'started_at': u'2015-03-18 14:43:45', u'admin_state_up': True, u'binary': u'neutron-dhcp-agent', u'host': u'devstack-trusty-rax-ord-1343601.slave.openstack.org', u'created_at': u'2015-03-18 14:43:45', u'description': u'description for update agent.', u'topic': u'dhcp_agent', u'agent_type': u'DHCP agent', u'id': u'25ea8e00-36e8-4408-9b00-d60e8b3a9b39'} not in [{u'alive': True, u'started_at': u'2015-03-18 14:43:45', u'admin_state_up': True, u'binary': u'neutron-dhcp-agent', u'host': u'devstack-trusty-rax-ord-1343601.slave.openstack.org', u'created_at': u'2015-03-18 14:43:45', u'description': u'', u'topic': u'dhcp_agent', u'agent_type': u'DHCP agent', u'id': u'25ea8e00-36e8-4408-9b00-d60e8b3a9b39'}, {u'alive': True, u'started_at': u'2015-03-18 14:43:45', u'admin_state_up': True, u'binary': u'neutron-lbaas-agent', u'host': u'devstack-trusty-rax-ord-1343601.slave.openstack.org', u'created_at': u'2015-03-18 14:43:45', u'description': None, u'topic': u'n-lbaas_agent', u'agent_type': u'Loadbalancer agent', u'id': u'667de509-9eb8-4350-9f42-9a8511b85e06'}, {u'alive': True, u'started_at': u'2015-03-18 14:43:45', u'admin_state_up': True, u'binary': u'neutron-openvswitch-agent', u'host': u'devstack-trusty-rax-ord-1343601.slave.openstack.org', u'created_at': u'2015-03-18 14:43:45', u'description': None, u'topic': u'N/A', u'agent_type': u'Open vSwitch agent', u'id': u'68006b4f-4950-46d6-b660-ddbe23c9b30c'}, {u'alive': True, u'started_at': u'2015-03-18 14:43:45', u'admin_state_up': True, u'binary': u'neutron-metering-agent', u'host': u'devstack-trusty-rax-ord-1343601.slave.openstack.org', u'created_at': u'2015-03-18 14:43:45', u'description': None, u'topic': u'metering_agent', u'agent_type': u'Metering agent', u'id': u'8f0f8c3a-b8fe-41c8-ad3a-191e26dd71a4'}, {u'alive': True, u'started_at': u'2015-03-18 14:43:45', u'admin_state_up': True, u'binary': u'neutron-l3-agent', u'host': u'devstack-trusty-rax-ord-1343601.slave.openstack.org', u'created_at': u'2015-03-18 14:43:45', u'description': None, u'topic': u'l3_agent', u'agent_type': u'L3 agent', u'id': u'f1ed957b-68ed-4669-9c85-84cac8095561'}, {u'alive': True, u'started_at': u'2015-03-18 14:43:45', u'admin_state_up': True, u'binary': u'neutron-metadata-agent', u'host': u'devstack-trusty-rax-ord-1343601.slave.openstack.org', u'created_at': u'2015-03-18 14:43:45', u'description': None, u'topic': u'N/A', u'agent_type': u'Metadata agent', u'id': u'fa4d51c9-5bbc-4a0b-b6f7-22f60eef742f'}]

Henry Gessau (gessau)
Changed in neutron:
assignee: nobody → Henry Gessau (gessau)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/168213

Changed in neutron:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/168213
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=eb79e5fe53e61af11033a5b824052d052ee755a9
Submitter: Jenkins
Branch: master

commit eb79e5fe53e61af11033a5b824052d052ee755a9
Author: Henry Gessau <email address hidden>
Date: Thu Mar 26 22:54:21 2015 -0400

    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

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → kilo-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: kilo-rc1 → 2015.1.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (neutron-pecan)

Fix proposed to branch: neutron-pecan
Review: https://review.openstack.org/185072

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.