KVM test: Make physical_resources_check cope with qemu change on 'info block'
PATCH 1/2 KVM test: Make physical_resources_check cope with qemu change on 'info block'
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 <[email protected]>
--- client/tests/kvm/tests/physical_resources_check.py | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-)
client/tests/kvm/tests/physical_resources_check.py +7 -3
@@ -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")
Signature · 1 line
1.7.5.1
PATCH 2/2 KVM test: Adding dmidecode to the list of packages on Fedora 14
So it's possible to execute the proper command to get memory assigned during physical_resources_check.
Signed-off-by Lucas Meneghel Rodrigues <[email protected]>
--- client/tests/kvm/unattended/Fedora-14.ks | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
client/tests/kvm/unattended/Fedora-14.ks +1 -0
@@ -22,6 +22,7 @@ autopart @development-libs @development-tools ntpdate +dmidecode %end %post --interpreter /usr/bin/python
Signature · 1 line
1.7.5.1