- if self.config.verbose:
- if status == 0:
- utils.header("%(test)s Susccessful " % locals())
- else:
- utils.header("%(test)s Failed " % locals())
- utils.header(output)
- results[test] = (stdout, stderr)
+ exe_pre, exe_script, exe_post = None, script['name'], None
+ if script['pre']: exe_pre = script['exe_pre']
+ if script['args']: exe_script = "%s %s" % (script['name'], script['args'])
+ if script['post']: exe_post = script['exe_post']
+
+ # Create a separate logfile for this script
+ logfile = Logfile(self.config.logfile.dir + script['name'] + ".log")
+ for command in [exe_pre, exe_script, exe_post]:
+ if command:
+ command = "cd %(tests_dir)s/%(archive_dir)s && ./%(command)s" % locals()
+ print >> node.logfile, command
+ print >> logfile, command
+
+ # Execute script on node
+ (stdout, stderr) = node.popen(command, False)
+ print >> node.logfile, "".join(stdout)
+ print >> logfile, "".join(stdout)
+ if self.config.verbose:
+ utils.header(stdout, logfile = self.config.logfile)
+ results[test] = (stdout, stderr)