← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1676877] [NEW] Increase "TestQosPlugin.test_update_policy_rule" coverage

 

Public bug reported:

Test "test_update_policy_rule" [1] is not fully testing the functionality of the function under test, for several reasons:
- The test is not testing the QoS policy object has the rule updated. In [2], the QoS policy reload the rules by requesting from the DB the new rule objects and then writing the result to "rules" member. [3] should be mocked to return the correct values (updated rules).
- The test is updating the rule value with the same content. At least there should be a change in the content to check the difference.
- Function "_validate_driver_params" should check not only the last parameter in the notification driver and the service notification call is a QosPolicy object, but also the content of the parameter.


[1] https://github.com/openstack/neutron/blob/master/neutron/tests/unit/services/qos/test_qos_plugin.py#L155
[2] https://github.com/openstack/neutron/blob/master/neutron/services/qos/qos_plugin.py#L94
[3] https://github.com/openstack/neutron/blob/master/neutron/objects/qos/policy.py#L80

** Affects: neutron
     Importance: Undecided
     Assignee: Reedip (reedip-banerjee)
         Status: New


** Tags: qos

** Tags added: qos

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1676877

Title:
  Increase "TestQosPlugin.test_update_policy_rule"  coverage

Status in neutron:
  New

Bug description:
  Test "test_update_policy_rule" [1] is not fully testing the functionality of the function under test, for several reasons:
  - The test is not testing the QoS policy object has the rule updated. In [2], the QoS policy reload the rules by requesting from the DB the new rule objects and then writing the result to "rules" member. [3] should be mocked to return the correct values (updated rules).
  - The test is updating the rule value with the same content. At least there should be a change in the content to check the difference.
  - Function "_validate_driver_params" should check not only the last parameter in the notification driver and the service notification call is a QosPolicy object, but also the content of the parameter.

  
  [1] https://github.com/openstack/neutron/blob/master/neutron/tests/unit/services/qos/test_qos_plugin.py#L155
  [2] https://github.com/openstack/neutron/blob/master/neutron/services/qos/qos_plugin.py#L94
  [3] https://github.com/openstack/neutron/blob/master/neutron/objects/qos/policy.py#L80

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1676877/+subscriptions


Follow ups