NSB: Fix standalone.model.Libvirt SR-IOV modeling 31/46531/10
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:03:26 +0000 (06:03 +0000)
commit6cfec77db6b95af5b31b741d513955ee3dfa3bb2
treeba8174fdf1b328355b1d591be0a0a735feeca889
parent93f53ca898891f5fd5fb5994c40932900aea1e73
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>
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