[PATCH 02/18] KVM test: Make physical_resources_check to work with MAC management

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The previous MAC address management breaks up the
physical_resources_check test (the test picks up NIC MAC parameters
from test parameters). Let's fix it by making it retrieve params
from the method VM.get_mac_address()

Signed-off-by: Lucas Meneghel Rodrigues <lmr@xxxxxxxxxx>
---
 client/tests/kvm/tests/physical_resources_check.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/client/tests/kvm/tests/physical_resources_check.py b/client/tests/kvm/tests/physical_resources_check.py
index 0f7cab3..6c8e154 100644
--- a/client/tests/kvm/tests/physical_resources_check.py
+++ b/client/tests/kvm/tests/physical_resources_check.py
@@ -123,9 +123,14 @@ def run_physical_resources_check(test, params, env):
     found_mac_addresses = re.findall("macaddr=(\S+)", o)
     logging.debug("Found MAC adresses: %s" % found_mac_addresses)
 
+    nic_index = 0
     for nic_name in kvm_utils.get_sub_dict_names(params, "nics"):
         nic_params = kvm_utils.get_sub_dict(params, nic_name)
-        mac, ip = kvm_utils.get_mac_ip_pair_from_dict(nic_params)
+        if "address_index" in nic_params:
+            mac, ip = kvm_utils.get_mac_ip_pair_from_dict(nic_params)
+        else:
+            mac = vm.get_mac_address(nic_index)
+            nic_index += 1
         if not string.lower(mac) in found_mac_addresses:
             n_fail += 1
             logging.error("MAC address mismatch:")
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux