From patchwork Mon Sep 27 22:43:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 213552 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8RMforH032214 for ; Mon, 27 Sep 2010 22:41:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760354Ab0I0WlU (ORCPT ); Mon, 27 Sep 2010 18:41:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5207 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760343Ab0I0WlS (ORCPT ); Mon, 27 Sep 2010 18:41:18 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8RMf6L3017791 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 27 Sep 2010 18:41:06 -0400 Received: from virtlab105.virt.bos.redhat.com (virtlab105.virt.bos.redhat.com [10.16.72.124]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8RMf33p003834; Mon, 27 Sep 2010 18:41:05 -0400 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, mst@redhat.com, akong@redhat.com, jasowang@redhat.com, psuriset@linux.vnet.ibm.com, mgoldish@redhat.com, Lucas Meneghel Rodrigues Subject: [PATCH 02/18] KVM test: Make physical_resources_check to work with MAC management Date: Mon, 27 Sep 2010 18:43:48 -0400 Message-Id: <1285627444-2732-3-git-send-email-lmr@redhat.com> In-Reply-To: <1285627444-2732-1-git-send-email-lmr@redhat.com> References: <1285627444-2732-1-git-send-email-lmr@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 27 Sep 2010 22:41:51 +0000 (UTC) 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:")