From patchwork Tue Nov 17 17:40:50 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 60752 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAHHf3a5017393 for ; Tue, 17 Nov 2009 17:41:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752788AbZKQRk4 (ORCPT ); Tue, 17 Nov 2009 12:40:56 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752682AbZKQRkz (ORCPT ); Tue, 17 Nov 2009 12:40:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34005 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752723AbZKQRkz (ORCPT ); Tue, 17 Nov 2009 12:40:55 -0500 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 nAHHewA6030281 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 17 Nov 2009 12:40:58 -0500 Received: from localhost.localdomain (vpn-8-194.rdu.redhat.com [10.11.8.194]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nAHHepMX008752; Tue, 17 Nov 2009 12:40:56 -0500 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, jadmanski@google.com, Lucas Meneghel Rodrigues Subject: [PATCH 3/3] Make client behavior configurable Date: Tue, 17 Nov 2009 15:40:50 -0200 Message-Id: <1258479650-1646-3-git-send-email-lmr@redhat.com> In-Reply-To: <1258479650-1646-2-git-send-email-lmr@redhat.com> References: <1258479650-1646-1-git-send-email-lmr@redhat.com> <1258479650-1646-2-git-send-email-lmr@redhat.com> 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 diff --git a/client/bin/autotest b/client/bin/autotest index 282ae9a..285be4e 100755 --- a/client/bin/autotest +++ b/client/bin/autotest @@ -6,6 +6,7 @@ import os, sys, shutil import common from optparse import OptionParser from autotest_lib.client.bin import job +from autotest_lib.client.common_lib import global_config # Use the name of the binary to find the real installation directory @@ -58,5 +59,9 @@ options, args = parser.parse_args() if len(args) != 1: usage() +drop_caches = global_config.global_config.get_config_value('CLIENT', + 'drop_caches', + type=bool) + # JOB: run the specified job control file. -job.runjob(os.path.realpath(args[0]), options) +job.runjob(os.path.realpath(args[0]), drop_caches, options) diff --git a/client/bin/job.py b/client/bin/job.py index d36784f..2a75adb 100755 --- a/client/bin/job.py +++ b/client/bin/job.py @@ -16,6 +16,8 @@ from autotest_lib.client.bin import partition as partition_lib from autotest_lib.client.common_lib import base_job from autotest_lib.client.common_lib import error, barrier, log, logging_manager from autotest_lib.client.common_lib import base_packages, packages +from autotest_lib.client.common_lib import global_config + LAST_BOOT_TAG = object() NO_DEFAULT = object() @@ -228,7 +230,10 @@ class base_client_job(base_job.base_job): """ Perform the drop caches initialization. """ - self.drop_caches_between_iterations = True + self.drop_caches_between_iterations = ( + global_config.global_config.get_config_value('CLIENT', + 'drop_caches_between_iterations', + type=bool)) self.drop_caches = drop_caches if self.drop_caches: logging.debug("Dropping caches") @@ -1311,7 +1316,7 @@ class disk_usage_monitor: return decorator -def runjob(control, options): +def runjob(control, drop_caches, options): """ Run a job using the given control file. @@ -1339,7 +1344,7 @@ def runjob(control, options): if options.cont and not os.path.exists(state): raise error.JobComplete("all done") - myjob = job(control, options) + myjob = job(control=control, drop_caches=drop_caches, options=options) # Load in the users control file, may do any one of: # 1) execute in toto