NSB: Fix standalone.model.Libvirt SR-IOV modeling 37/49037/2
authorDino Madarang <dinox.madarang@intel.com>
Wed, 1 Nov 2017 16:10:16 +0000 (09:10 -0700)
committerRoss Brattain <ross.b.brattain@intel.com>
Fri, 15 Dec 2017 06:34:20 +0000 (06:34 +0000)
commitb987bf5f1eb65fe8534d01b9de2a7b74fc16f84d
tree1be0cc8541cbd256a3134a15096081d1c9c3b6a4
parentb553e726ac2d0aa3c62a510116e591392a104883
NSB: Fix standalone.model.Libvirt SR-IOV modeling

Fixed standalone.model.Libvirt SR-IOV XML interface modeling, acording
to [1]:
- All PCI attributes now are printed in hexadecimal format.
- The PCI address is now added in the correct section, 'interface'.

network_services.utils.PciAddress was refactored to accept both 'domain:
bus:slot:function' and 'bus:slot:function' format inputs. This class is
used as input in the previous class, Libvirt, to print in XML the PCI
address of a SR-IOV interface.

network_services.utils.PciAddress.parse_address is now deprecated. Instead
the class standard instantiation must be used:

    libvirt_obj = utils.PciAddress(text_with_address)

A deprecation decorator is implemented along with this patch. This
decorator is used for the first time in the previously mentioned function.
This decorator stores every decorated function name and deprecation message
and raises a logging warning message the first time this function is used.

[1] https://goo.gl/so2Mrp

Change-Id: I22e95c488e27d6e2a8fdf6c1a07faab275fa6bba
Signed-off-by: Dino Simeon Madarang <dinox.madarang@intel.com>
Reviewed-by: Alain Jebara <alain.jebara@intel.com>
Reviewed-by: Deepak S <deepak.s@linux.intel.com>
Reviewed-by: Ross Brattain <ross.b.brattain@intel.com>
Reviewed-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
(cherry picked from commit 6cfec77db6b95af5b31b741d513955ee3dfa3bb2)
tests/unit/benchmark/contexts/standalone/test_model.py
tests/unit/benchmark/contexts/standalone/test_sriov.py
tests/unit/network_services/test_utils.py
yardstick/benchmark/contexts/standalone/model.py
yardstick/benchmark/contexts/standalone/ovs_dpdk.py
yardstick/benchmark/contexts/standalone/sriov.py
yardstick/network_services/utils.py