From patchwork Mon Apr 26 10:07:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 95038 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 o3QA2qJp011050 for ; Mon, 26 Apr 2010 10:02:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753921Ab0DZKCt (ORCPT ); Mon, 26 Apr 2010 06:02:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53002 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753480Ab0DZKCt (ORCPT ); Mon, 26 Apr 2010 06:02:49 -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 o3QA2mV7015922 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 26 Apr 2010 06:02:48 -0400 Received: from localhost.localdomain ([10.66.91.25]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3QA2jKS006926; Mon, 26 Apr 2010 06:02:46 -0400 Subject: [PATCH 2/3] KVM test: Create ksm scanner through pre_command To: autotest@test.kernel.org, lmr@redhat.com From: Jason Wang Cc: kvm@vger.kernel.org Date: Mon, 26 Apr 2010 18:07:35 +0800 Message-ID: <20100426100734.26501.22279.stgit@localhost.localdomain> In-Reply-To: <20100426100726.26501.73186.stgit@localhost.localdomain> References: <20100426100726.26501.73186.stgit@localhost.localdomain> User-Agent: StGit/0.15 MIME-Version: 1.0 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 (demeter.kernel.org [140.211.167.41]); Mon, 26 Apr 2010 10:02:52 +0000 (UTC) diff --git a/client/tests/kvm/tests/ksm_overcommit.py b/client/tests/kvm/tests/ksm_overcommit.py index 2dd46c4..4aa6deb 100644 --- a/client/tests/kvm/tests/ksm_overcommit.py +++ b/client/tests/kvm/tests/ksm_overcommit.py @@ -412,21 +412,6 @@ def run_ksm_overcommit(test, params, env): (3100 - 64.0))) mem = int(math.floor(host_mem * overcommit / vmsc)) - logging.debug("Checking KSM status...") - ksm_flag = 0 - for line in os.popen('ksmctl info').readlines(): - if line.startswith('flags'): - ksm_flag = int(line.split(' ')[1].split(',')[0]) - if int(ksm_flag) != 1: - logging.info("KSM module is not loaded! Trying to load module and " - "start ksmctl...") - try: - utils.run("modprobe ksm") - utils.run("ksmctl start 5000 100") - except error.CmdError, e: - raise error.TestFail("Failed to load KSM: %s" % e) - logging.debug("KSM module loaded and ksmctl started") - swap = int(utils.read_from_meminfo("SwapTotal")) / 1024 logging.debug("Overcommit = %f", overcommit) diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample index e73ba44..2db0d2c 100644 --- a/client/tests/kvm/tests_base.cfg.sample +++ b/client/tests/kvm/tests_base.cfg.sample @@ -285,6 +285,8 @@ variants: catch_uuid_cmd = dmidecode | awk -F: '/UUID/ {print $2}' - ksm_overcommit: + pre_command = "[ -e /dev/ksm ] && true || modprobe ksm && ksmctl start 5000 50" + pre_command_critical = yes # Don't preprocess any vms as we need to change its params vms = '' image_snapshot = yes