@@ -12,8 +12,9 @@ class ClientLoggingConfig(logging_config.LoggingConfig):
def configure_logging(self, results_dir=None, verbose=False):
- super(ClientLoggingConfig, self).configure_logging(use_console=True,
- verbose=verbose)
+ super(ClientLoggingConfig, self).configure_logging(
+ use_console=self.use_console,
+ verbose=verbose)
if results_dir:
log_dir = os.path.join(results_dir, 'debug')
@@ -1117,6 +1117,7 @@ class base_job(object):
tag_parts = []
# build up the parts of the tag used for the test name
+ master_testpath = dargs.get('master_testpath', "")
base_tag = dargs.pop('tag', None)
if base_tag:
tag_parts.append(str(base_tag))
@@ -1132,6 +1133,7 @@ class base_job(object):
if subdir_tag:
tag_parts.append(subdir_tag)
subdir = '.'.join([testname] + tag_parts)
+ subdir = os.path.join(master_testpath, subdir)
tag = '.'.join(tag_parts)
return full_testname, subdir, tag
@@ -32,9 +32,10 @@ class LoggingConfig(object):
fmt='%(asctime)s %(levelname)-5.5s| %(message)s',
datefmt='%H:%M:%S')
- def __init__(self):
+ def __init__(self, use_console=True):
self.logger = logging.getLogger()
self.global_level = logging.DEBUG
+ self.use_console = use_console
@classmethod
@@ -465,6 +465,24 @@ class base_test(object):
self.job.enable_warnings("NETWORK")
+ def runsubtest(self, url, *args, **dargs):
+ """
+ Execute another autotest test from inside the current test's scope.
+
+ @param test: Parent test.
+ @param url: Url of new test.
+ @param tag: Tag added to test name.
+ @param args: Args for subtest.
+ @param dargs: Dictionary with args for subtest.
+ @iterations: Number of subtest iterations.
+ @profile_only: If true execute one profiled run.
+ """
+ dargs["profile_only"] = dargs.get("profile_only", False)
+ test_basepath = self.outputdir[len(self.job.resultdir + "/"):]
+ self.job.run_test(url, master_testpath=test_basepath,
+ *args, **dargs)
+
+
def _get_nonstar_args(func):
"""Extract all the (normal) function parameter names.
@@ -658,7 +676,8 @@ def runtest(job, url, tag, args, dargs,
if not bindir:
raise error.TestError(testname + ': test does not exist')
- outputdir = os.path.join(job.resultdir, testname)
+ subdir = os.path.join(dargs.pop('master_testpath', ""), testname)
+ outputdir = os.path.join(job.resultdir, subdir)
if tag:
outputdir += '.' + tag
Do that by adding an additional utility function in the test object, that will call another test from inside the test scope. Signed-off-by: Jiri Zupka <jzupka@redhat.com> --- client/bin/client_logging_config.py | 5 +++-- client/common_lib/base_job.py | 2 ++ client/common_lib/logging_config.py | 3 ++- client/common_lib/test.py | 21 ++++++++++++++++++++- 4 files changed, 27 insertions(+), 4 deletions(-)