From patchwork Fri May 20 18:49:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 804522 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4KInUGl004367 for ; Fri, 20 May 2011 18:49:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935528Ab1ETSt1 (ORCPT ); Fri, 20 May 2011 14:49:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17104 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935485Ab1ETSt0 (ORCPT ); Fri, 20 May 2011 14:49:26 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4KInPub014349 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 20 May 2011 14:49:25 -0400 Received: from freedom.redhat.com (vpn-8-141.rdu.redhat.com [10.11.8.141]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p4KInNDM023431; Fri, 20 May 2011 14:49:24 -0400 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Lucas Meneghel Rodrigues Subject: [PATCH 1/2] KVM test: Make physical_resources_check cope with qemu change on 'info block' Date: Fri, 20 May 2011 15:49:30 -0300 Message-Id: <1305917371-1210-1-git-send-email-lmr@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 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.6 (demeter2.kernel.org [140.211.167.43]); Fri, 20 May 2011 18:49:30 +0000 (UTC) New qemu upstream versions report block info like this: (monitor humanmonitor1) Sending command 'info block' (monitor humanmonitor1) Response to 'info block' (monitor humanmonitor1) virtio0: removable=0 file=/tmp/kvm_autotest_root/images/rhel6-64.qcow2 ro=0 drv=qcow2 encrypted=0 (monitor humanmonitor1) ide1-cd0: removable=1 locked=0 [not inserted] (monitor humanmonitor1) floppy0: removable=1 locked=0 [not inserted] (monitor humanmonitor1) sd0: removable=1 locked=0 [not inserted] While older versions report like this: (monitor humanmonitor1) Sending command 'info block' (monitor humanmonitor1) Response to 'info block' (monitor humanmonitor1) virtio0: type=hd removable=0 file=/tmp/kvm_autotest_root/images/rhel6-64.qcow2 ro=0 drv=qcow2 encrypted=0 (monitor humanmonitor1) ide1-cd0: type=cdrom removable=1 locked=0 [not inserted] (monitor humanmonitor1) floppy0: type=floppy removable=1 locked=0 [not inserted] (monitor humanmonitor1) sd0: type=floppy removable=1 locked=0 [not inserted] The type field was removed, as it wasn't reliably. So for searching for hard drives, look for the disk image name rather than the type tags. Signed-off-by: Lucas Meneghel Rodrigues --- client/tests/kvm/tests/physical_resources_check.py | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/client/tests/kvm/tests/physical_resources_check.py b/client/tests/kvm/tests/physical_resources_check.py index 53a23d1..5415a09 100644 --- a/client/tests/kvm/tests/physical_resources_check.py +++ b/client/tests/kvm/tests/physical_resources_check.py @@ -1,6 +1,6 @@ import re, string, logging from autotest_lib.client.common_lib import error -from autotest_lib.client.virt import kvm_monitor +from autotest_lib.client.virt import kvm_monitor, virt_vm def run_physical_resources_check(test, params, env): @@ -29,6 +29,9 @@ def run_physical_resources_check(test, params, env): # resources to know which checks passed and which ones failed n_fail = 0 + # We will check HDs with the image name + image_name = virt_vm.get_image_filename(params, test.bindir) + # Check cpu count logging.info("CPU count check") expected_cpu_nr = int(params.get("smp")) @@ -70,7 +73,7 @@ def run_physical_resources_check(test, params, env): return expected_num, f_fail logging.info("Hard drive count check") - n_fail += check_num("images", "block", "type=hd")[1] + n_fail += check_num("images", "block", image_name)[1] logging.info("NIC count check") n_fail += check_num("nics", "network", "model=")[1] @@ -111,7 +114,8 @@ def run_physical_resources_check(test, params, env): n_fail += f_fail logging.info("Drive format check") - f_fail = chk_fmt_model("images", "drive_format", "block", "(.*)\: type=hd") + f_fail = chk_fmt_model("images", "drive_format", + "block", "(.*)\: .*%s" % image_name) n_fail += f_fail logging.info("Network card MAC check")