From: Lucas Meneghel Rodrigues <lmr@redhat.com>
To: autotest@test.kernel.org
Cc: kvm@vger.kernel.org, jadmanski@google.com,
Lucas Meneghel Rodrigues <lmr@redhat.com>
Subject: [PATCH 3/3] Make client behavior configurable
Date: Tue, 17 Nov 2009 15:40:50 -0200 [thread overview]
Message-ID: <1258479650-1646-3-git-send-email-lmr@redhat.com> (raw)
In-Reply-To: <1258479650-1646-2-git-send-email-lmr@redhat.com>
Right now autotest will drop caches between:
* Test executions
* Same test iterations
This change turns those into configurable options on
global_config.ini. The default values were added on the
previous patch.
2nd attempt: Now global config support for stand alone client
runs was added. Everything should work now.
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
---
client/bin/autotest | 7 ++++++-
client/bin/job.py | 11 ++++++++---
2 files changed, 14 insertions(+), 4 deletions(-)
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
--
1.6.2.5
next prev parent reply other threads:[~2009-11-17 17:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-17 17:40 [PATCH 1/3] Adding AutoservInstallError to common_lib.error Lucas Meneghel Rodrigues
2009-11-17 17:40 ` [PATCH 2/3] Make a standalone client to be able to use global_config.ini Lucas Meneghel Rodrigues
2009-11-17 17:40 ` Lucas Meneghel Rodrigues [this message]
2009-11-17 18:02 ` John Admanski
-- strict thread matches above, loose matches on Subject: below --
2009-11-18 0:56 [PATCH 1/3] Adding AutoservInstallError to common_lib.error Lucas Meneghel Rodrigues
2009-11-18 0:56 ` [PATCH 2/3] Make a standalone client to be able to use global_config.ini Lucas Meneghel Rodrigues
2009-11-18 0:56 ` [PATCH 3/3] Make client behavior configurable Lucas Meneghel Rodrigues
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1258479650-1646-3-git-send-email-lmr@redhat.com \
--to=lmr@redhat.com \
--cc=autotest@test.kernel.org \
--cc=jadmanski@google.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox