diff --git a/validate/tools/launcher/baseclasses.py b/validate/tools/launcher/baseclasses.py index d78a2b8ca7..7b79bd2d45 100644 --- a/validate/tools/launcher/baseclasses.py +++ b/validate/tools/launcher/baseclasses.py @@ -63,15 +63,20 @@ class Test(Loggable): self._starting_time = None self.result = Result.NOT_RUN self.logfile = None + self.extra_logfiles = [] def __str__(self): string = self.classname if self.result != Result.NOT_RUN: string += ": " + self.result if self.result in [Result.FAILED, Result.TIMEOUT]: - string += " '%s'\n You can reproduce with: %s\n " \ - "You can find logs in: %s" % (self.message, self.command, - self.logfile) + string += " '%s'\n" \ + " You can reproduce with: %s\n" \ + " You can find logs in:\n" \ + " - %s" % (self.message, self.command, + self.logfile) + for log in self.extra_logfiles: + string += "\n - %s" % log return string @@ -173,20 +178,30 @@ class Test(Loggable): self.check_results() + def get_subproc_env(self): + return os.environ + def run(self): self.command = "%s " % (self.application) self._starting_time = time.time() self.build_arguments() - printc("Launching: %s%s\n" - " logs are in %s\n" - " Command: '%s'" - % (Colors.ENDC, self.classname, - self.logfile, self.command), Colors.OKBLUE) + proc_env = self.get_subproc_env() + + message = "Launching: %s%s\n" \ + " Command: '%s'\n" \ + " Logs:\n" \ + " - %s" % (Colors.ENDC, self.classname, + self.command, self.logfile) + for log in self.extra_logfiles: + message += "\n - %s" % log + + printc(message, Colors.OKBLUE) try: self.process = subprocess.Popen(self.command, stderr=self.reporter.out, stdout=self.reporter.out, - shell=True) + shell=True, + env=proc_env) self.wait_process() except KeyboardInterrupt: self.process.kill() @@ -234,6 +249,16 @@ class GstValidateTest(Test): else: self.scenario = scenario + def get_subproc_env(self): + subproc_env = os.environ.copy() + + if 'GST_DEBUG' in os.environ: + gstlogsfile = self.logfile + '.gstdebug' + self.extra_logfiles.append(gstlogsfile) + subproc_env["GST_DEBUG_FILE"] = gstlogsfile + + return subproc_env + def clean(self): Test.clean(self) self._sent_eos_pos = None diff --git a/validate/tools/launcher/utils.py b/validate/tools/launcher/utils.py index 9d1bc7811e..2bb75789c6 100644 --- a/validate/tools/launcher/utils.py +++ b/validate/tools/launcher/utils.py @@ -29,7 +29,7 @@ from operator import itemgetter GST_SECOND = long(1000000000) -DEFAULT_TIMEOUT = 10 +DEFAULT_TIMEOUT = 30 DEFAULT_MAIN_DIR = os.path.expanduser("~/gst-validate/") DEFAULT_GST_QA_ASSETS = os.path.join(DEFAULT_MAIN_DIR, "gst-qa-assets") DISCOVERER_COMMAND = "gst-discoverer-1.0"