Improve unit test coverage for Cisco plugin base code

Bug #1190621 reported by Henry Gessau
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Wishlist
Dane LeBlanc

Bug Description

Improve unit test coverage for ...

quantum/plugins/cisco/network_plugin 199 131 0 17 2 34%

Tags: unittest cisco
Changed in quantum:
importance: Undecided → Wishlist
status: New → Triaged
ZhiQiang Fan (aji-zqfan)
tags: added: unittest
Dane LeBlanc (leblancd)
Changed in neutron:
assignee: nobody → Dane LeBlanc (leblancd)
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/58882

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

Reviewed: https://review.openstack.org/58882
Committed: http://github.com/openstack/neutron/commit/3cb9168822a0805a9b8904ce54577f3e3f05d9eb
Submitter: Jenkins
Branch: master

commit 3cb9168822a0805a9b8904ce54577f3e3f05d9eb
Author: Dane LeBlanc <email address hidden>
Date: Wed Nov 27 17:24:35 2013 -0500

    Improve unit test coverage for Cisco plugin base code

    Closes-Bug: #1190621

    This fix improves test code coverage for the file:
    neutron/plugins/cisco/network_plugin.py
    from 34% to 98%.

    Some of the changes made to realize this code coverage improvements
    are the following:
    - Core API methods (create_network, update_network, etc.) have been
      removed from the core plugin (network_plugin.py). These methods
      are currently unused. Before this change, we relied on the underlying
      model layer to inform the core plugin whether or not the model layer
      was capable of handling these core API calls itself via a 'MANAGE_STATE'
      attribute. However, there is only one existing model layer
      implementation (i.e. for Nexus plugin; the N1KV plugin does not use
      network_plugin.py), and that model layer supports the core API calls.
      Given that it is unlikely that another model layer for the Cisco Nexus
      plugin will ever be developed (esp. with the availability of the ML2
      plugin), so it makes more sense to delete this untested code.
    - Exception raising for non-existent credentials has been removed from
      get_credential_details and rename_credential methods since
      exceptions are already raised for this condition in lower-level
      credential database code.
    - The schedule_host, associate_port, and detach_port methods are
      deleted because these essentially do nothing useful (log a debug
      message and then return None), since these methods look for
      the same-named methods in the model layer, but these methods are
      not defined in the model layer.
    - The helper functions _invoke_device_plugins and _func_name are
      deleted because they are no longer used.
    - In unit test code for the Cisco QoS and credentials database, calls
      are now made indirectly through the core plugin (network_plugin.py)
      extension API methods, as a quick-and-easy way to provide code
      coverage for these core plugin methods.

    Change-Id: I0c0d9e2b251a7c0355d83e495912302c5cc4d032

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