Testing method for LBaaS update status() is partially wrong

Bug #1212229 reported by Evgeny Fedoruk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Eugene Nikanorov

Bug Description

In testing class of the db_loadbalancer (\neutron\tests\unit\db\loadbalancer\test_db_loadbalancer.py)
is a method testing the update_status functionality, test_update_status().

The last line of the test is checking that status description was cleared
after invoking the update_status() without description parameter.

The problem is that assert checks the pool object (the original object after creation)
instead of updated_pool object which was retrieved after the update_status() invocation.

That causes the last assert to always succeed.

Suggestion for fix:
Use the updated_pool object in assertFalse(),
e.g. self.assertFalse(updated_pool['status_description'])

Tags: lbaas unittest
Changed in neutron:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → Eugene Nikanorov (enikanorov)
tags: added: lbaas unittest
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/41918

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

Reviewed: https://review.openstack.org/41918
Committed: http://github.com/openstack/neutron/commit/47dca8211ab50f971f95a47a40a7f4cdc79e3b3a
Submitter: Jenkins
Branch: master

commit 47dca8211ab50f971f95a47a40a7f4cdc79e3b3a
Author: Eugene Nikanorov <email address hidden>
Date: Wed Aug 14 16:53:22 2013 +0400

    Fix test_update_status unit test in Loadbalancer test suite

    Add proper check of the updated object.

    fixes bug 1212229

    Change-Id: Icbe0a127a045ff93630dfa7f8d3fd6af771ddc5e

Changed in neutron:
status: In Progress → Fix Committed
Changed in neutron:
milestone: none → havana-3
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: havana-3 → 2013.2
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.