From mboxrd@z Thu Jan 1 00:00:00 1970 From: 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> References: <1285627444-2732-1-git-send-email-lmr@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, mst@redhat.com To: autotest@test.kernel.org Return-path: In-Reply-To: <1285627444-2732-1-git-send-email-lmr@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: autotest-bounces@test.kernel.org Errors-To: autotest-bounces@test.kernel.org List-Id: kvm.vger.kernel.org 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 --- 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