From patchwork Tue Sep 14 22:25:27 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: 181132 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 o8EMPxOM022358 for ; Tue, 14 Sep 2010 22:25:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753041Ab0INWZz (ORCPT ); Tue, 14 Sep 2010 18:25:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39873 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751851Ab0INWZz (ORCPT ); Tue, 14 Sep 2010 18:25:55 -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 o8EMPsBc032735 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 14 Sep 2010 18:25:54 -0400 Received: from freedom.redhat.com (vpn-10-95.rdu.redhat.com [10.11.10.95]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8EMPlui004475; Tue, 14 Sep 2010 18:25:52 -0400 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Lucas Meneghel Rodrigues Subject: [PATCH 02/18] KVM test: Make physical_resources_check to work with MAC management Date: Tue, 14 Sep 2010 19:25:27 -0300 Message-Id: <1284503143-5993-3-git-send-email-lmr@redhat.com> In-Reply-To: <1284503143-5993-1-git-send-email-lmr@redhat.com> References: <1284503143-5993-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]); Tue, 14 Sep 2010 22:25:59 +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:")