diff mbox

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

Message ID 1285627444-2732-3-git-send-email-lmr@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lucas Meneghel Rodrigues Sept. 27, 2010, 10:43 p.m. UTC
None
diff mbox

Patch

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:")