From patchwork Thu Feb 11 17:29:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: pradeep kumar X-Patchwork-Id: 78752 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1BHUL9g017845 for ; Thu, 11 Feb 2010 17:30:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756133Ab0BKRaS (ORCPT ); Thu, 11 Feb 2010 12:30:18 -0500 Received: from e38.co.us.ibm.com ([32.97.110.159]:41697 "EHLO e38.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755311Ab0BKRaR (ORCPT ); Thu, 11 Feb 2010 12:30:17 -0500 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by e38.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id o1BHOklG003320 for ; Thu, 11 Feb 2010 10:24:46 -0700 Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o1BHU6TM102204 for ; Thu, 11 Feb 2010 10:30:06 -0700 Received: from d03av05.boulder.ibm.com (loopback [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o1BHU6ZC015708 for ; Thu, 11 Feb 2010 10:30:06 -0700 Received: from [9.77.92.6] ([9.77.92.6]) by d03av05.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id o1BHU0np015104; Thu, 11 Feb 2010 10:30:02 -0700 Message-ID: <4B743E97.4040102@linux.vnet.ibm.com> Date: Thu, 11 Feb 2010 22:59:59 +0530 From: pradeep User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: autotest@test.kernel.org, kvm@vger.kernel.org, lmr@redhat.com Subject: [Autotest] [PATCH] KVM test: Memory ballooning test for KVM guest 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 (demeter.kernel.org [140.211.167.41]); Thu, 11 Feb 2010 17:30:21 +0000 (UTC) diff -uprN a/client/tests/kvm/tests/balloon_check.py b/client/tests/kvm/tests/balloon_check.py --- a/client/tests/kvm/tests/balloon_check.py 2010-02-11 20:31:49.197953539 +0530 +++ b/client/tests/kvm/tests/balloon_check.py 1970-01-01 05:30:00.000000000 +0530 @@ -1,63 +0,0 @@ -import re, string, logging -from autotest_lib.client.common_lib import error -import kvm_test_utils, kvm_utils - -def run_balloon_check(test, params, env): - """ - Check Memory ballooning: - 1) Boot a guest - 2) Increase and decrease the memory of guest using balloon command from monitor - 3) check memory info - - @param test: kvm test object - @param params: Dictionary with the test parameters - @param env: Dictionary with test environment. - """ - - vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) - session = kvm_test_utils.wait_for_login(vm) - fail = 0 - - # Check memory size - ogging.info("Memory size check") - expected_mem = int(params.get("mem")) - actual_mem = vm.get_memory_size() - if actual_mem != expected_mem: - logging.error("Memory size mismatch:") - logging.error(" Assigned to VM: %s" % expected_mem) - logging.error(" Reported by OS: %s" % actual_mem) - - #check info balloon command - o, str = vm.send_monitor_cmd("info balloon") - if o != 0: - logging.error("qemu monitor command failed:") - s =int(re.findall("\d+",str)[0]) - if s != actual_mem: - logging.error("qemu monitor command failed: info balloon") - raise error.TestFail("Memory ballooning failed while decreasing memory") - - #Reduce memory to 80% of actual memory - new_mem = int (0.8 * actual_mem) - vm.send_monitor_cmd(" balloon %s " % new_mem) - o, str = vm.send_monitor_cmd("info balloon") - if o != 0: - logging.error("qemu monitor command failed:") - s = int(re.findall("\d+",str)[0]) - if s != new_mem: - logging.error(" memory ballooning failed ") - fail = 1 - - # increase memory to actual size - vm.send_monitor_cmd(" balloon %s " % new_mem ) - o,str = vm.send_monitor_cmd("info balloon") - if o != 0: - logging.error("qemu monitor command failed:") - s = int(re.findall("\d+",str)[0]) - if s != actual_mem: - logging.error("Memory ballooning failed while increasing memory") - fail = 1 - - #Checking for test result - if fail != 0: - raise error.TestFail("Memory ballooning test failed ") - session.close() diff -uprN a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample --- a/client/tests/kvm/tests_base.cfg.sample 2010-02-11 21:12:13.792955256 +0530 +++ b/client/tests/kvm/tests_base.cfg.sample 2010-02-11 20:24:06.408947096 +0530 @@ -158,10 +158,6 @@ variants: drift_threshold = 10 drift_threshold_single = 3 - - balloon_check: install setup unattended_install - type = balloon_check - extra_params += "-balloon virtio" - - stress_boot: install setup unattended_install type = stress_boot max_vms = 5 @@ -320,7 +316,7 @@ variants: variants: - 8.32: - no setup balloon_check + no setup image_name = fc8-32 cdrom = linux/Fedora-8-i386-DVD.iso md5sum = dd6c79fddfff36d409d02242e7b10189 @@ -331,7 +327,7 @@ variants: unattended_file = unattended/Fedora-8.ks - 8.64: - no setup balloon_check + no setup image_name = fc8-64 cdrom = linux/Fedora-8-x86_64-DVD.iso md5sum = 2cb231a86709dec413425fd2f8bf5295 @@ -342,7 +338,6 @@ variants: unattended_file = unattended/Fedora-8.ks - 9.32: - no balloon_check image_name = fc9-32 cdrom = linux/Fedora-9-i386-DVD.iso md5sum = 72601f685ea8c808c303353d8bf4d307 @@ -353,7 +348,6 @@ variants: unattended_file = unattended/Fedora-9.ks - 9.64: - no balloon_check image_name = fc9-64 cdrom = linux/Fedora-9-x86_64-DVD.iso md5sum = 05b2ebeed273ec54d6f9ed3d61ea4c96 @@ -364,7 +358,6 @@ variants: unattended_file = unattended/Fedora-9.ks - 10.32: - no balloon_check image_name = fc10-32 cdrom = linux/Fedora-10-i386-DVD.iso md5sum = 27e581edb392728c4a07d00d3fc5ced0 @@ -373,7 +366,6 @@ variants: unattended_file = unattended/Fedora-10.ks - 10.64: - no balloon_check image_name = fc10-64 cdrom = linux/Fedora-10-x86_64-DVD.iso sha1sum = f1e5ae7db6a1ba227de7294c4112385922388648 @@ -382,7 +374,6 @@ variants: unattended_file = unattended/Fedora-10.ks - 11.32: - no balloon_check image_name = fc11-32 cdrom = linux/Fedora-11-i386-DVD.iso md5sum = e3b1e2d1ba42aa4705fa5f41771b3927 @@ -393,7 +384,6 @@ variants: unattended_file = unattended/Fedora-11.ks - 11.64: - no balloon_check image_name = fc11-64 cdrom = linux/Fedora-11-x86_64-DVD.iso md5sum = 9d419844adeb93120215fe7505c9bce8 @@ -418,7 +408,7 @@ variants: unattended_file = unattended/Fedora-12.ks - DSL-4.2.5: - no setup dbench bonnie linux_s3 balloon_check + no setup dbench bonnie linux_s3 image_name = dsl-4.2.5 install: steps = DSL-4.2.5.steps @@ -427,7 +417,7 @@ variants: md5sum_1m = 527f2481bd25310f2e3a6e5345ff3d12 - Mandriva-One-2007: - only install + only install image_name = mandriva-one-2007 steps = Mandriva-One-2007-32.steps cdrom = linux/mandriva-one-2007-i386.iso @@ -435,7 +425,7 @@ variants: md5sum_1m = dc7865a75db665efc86d59bca7c1fe07 - openSUSE-11.0.32: - no setup dbench bonnie balloon_check + no setup dbench bonnie image_name = openSUSE-11.0-32 install: steps = openSUSE-11.0-32.steps @@ -444,7 +434,7 @@ variants: md5sum_1m = c720b30557af758e69de450409516369 - openSUSE-11.1.32: - no setup dbench bonnie balloon_check + no setup dbench bonnie image_name = openSUSE-11.1-32 install: steps = openSUSE-11.1-32-and-64.steps @@ -453,7 +443,7 @@ variants: md5sum_1m = b70217417468389083429f81ba7ce2bd - openSUSE-11.1.64: - no setup dbench bonnie balloon_check + no setup dbench bonnie image_name = openSUSE-11.1-64 install: steps = openSUSE-11.1-32-and-64.steps @@ -506,7 +496,7 @@ variants: variants: - 3.9.i386: - no setup autotest linux_s3 balloon_check + no setup autotest linux_s3 image_name = rhel3-32 mem_chk_cmd = dmidecode | awk -F: '/Maximum Capacity/ {print $2}' cdrom = linux/RHEL-3.9-i386-DVD.iso @@ -518,7 +508,7 @@ variants: unattended_file = unattended/RHEL-3-series.ks - 3.9.x86_64: - no setup autotest linux_s3 balloon_check + no setup autotest linux_s3 image_name = rhel3-64 mem_chk_cmd = dmidecode | awk -F: '/Maximum Capacity/ {print $2}' cdrom = linux/RHEL-3.9-x86_64-DVD.iso @@ -530,7 +520,7 @@ variants: unattended_file = unattended/RHEL-3-series.ks - 4.7.i386: - no setup autotest balloon_check + no setup autotest image_name = rhel4-32 cdrom=linux/RHEL-4.7-i386-DVD.iso md5sum=ee5092653732a88ddbaf8eef2484c500 @@ -541,7 +531,7 @@ variants: unattended_file = unattended/RHEL-4-series.ks - 4.7.x86_64: - no setup autotest balloon_check + no setup autotest image_name = rhel4-64 cdrom=linux/RHEL-4.7-x86_64-DVD.iso md5sum=ea9dae16dd86f7d94092d0e672333292 @@ -552,7 +542,7 @@ variants: unattended_file = unattended/RHEL-4-series.ks - 4.8.i386: - no setup autotest balloon_check + no setup autotest image_name = rhel4-32 cdrom = linux/RHEL-4.8-i386-DVD.iso md5sum = b024f0af5079539d3ef51f71fed0b194 @@ -561,7 +551,7 @@ variants: unattended_file = unattended/RHEL-4-series.ks - 4.8.x86_64: - no setup autotest balloon_check + no setup autotest image_name = rhel4-64 cdrom = linux/RHEL-4.8-x86_64-DVD.iso md5sum = 696bc877b0200cc942626673fcc3fc09 @@ -570,7 +560,7 @@ variants: unattended_file = unattended/RHEL-4-series.ks - 5.3.i386: - no setup balloon_check + no setup image_name = rhel5-32 cdrom=linux/RHEL-5.3-i386-DVD.iso md5sum=371c62851611fd32ead440df6f24a296 @@ -581,7 +571,7 @@ variants: unattended_file = unattended/RHEL-5-series.ks - 5.3.x86_64: - no setup balloon_check + no setup image_name = rhel5-64 cdrom=linux/RHEL-5.3-x86_64-DVD.iso md5sum=c5ed6b284410f4d8212cafc78fd7a8c5 @@ -592,7 +582,7 @@ variants: unattended_file = unattended/RHEL-5-series.ks - 5.4.i386: - no setup balloon_check + no setup image_name = rhel5-32 cdrom = linux/RHEL-5.4-i386-DVD.iso md5sum = 7a12ec6599527e4f3d1790b51eadbfed @@ -601,7 +591,7 @@ variants: unattended_file = unattended/RHEL-5-series.ks - 5.4.x86_64: - no setup balloon_check + no setup image_name = rhel5-64 cdrom = linux/RHEL-5.4-x86_64-DVD.iso md5sum = 04fe3c10202402d7b389528d2bad0210 @@ -611,7 +601,7 @@ variants: # Windows section - @Windows: - no autotest linux_s3 vlan_tag balloon_check + no autotest linux_s3 vlan_tag shutdown_command = shutdown /s /t 0 reboot_command = shutdown /r /t 0 status_test_command = echo %errorlevel%