Lines Matching +full:stdout +full:- +full:path
37 from os.path import exists
68 return t.tv_sec + t.tv_nsec * 1e-9
79 self.stdout = []
89 m, s = divmod(monotonic_time() - self.starttime, 60)
167 The timeout for tests is measured in wall-clock time
194 signal = '-TERM'
207 If this is not a user-initiated kill and the test has not been
213 runtime = monotonic_time() - self.result.starttime
229 if os.path.isfile(cmd+'.ksh') and os.access(cmd+'.ksh', os.X_OK):
231 if os.path.isfile(cmd+'.sh') and os.access(cmd+'.sh', os.X_OK):
235 if not os.path.isfile(cmd):
236 if os.path.isfile(cmd+'.ksh') and os.access(cmd+'.ksh', os.X_OK):
238 if os.path.isfile(cmd+'.sh') and os.access(cmd+'.sh', os.X_OK):
241 ret = '%s -E -u %s %s' % (SUDO, user, cmd)
246 Read from stdout/stderr as data becomes available, until the
247 process is no longer running. Return the lines from the stdout and
250 out = Output(proc.stdout, debug)
280 if not os.path.isdir(self.outputdir):
292 kp = Popen([SUDO, "sh", "-c",
304 kp = Popen([SUDO, "sh", "-c",
313 cmd = f'{SUDO} sh -c "echo clear > {KMEMLEAK_FILE}"'
316 proc = Popen(privcmd, stdout=PIPE, stderr=PIPE)
328 self.result.stdout = out
332 cmd = f'{SUDO} sh -c "echo scan > {KMEMLEAK_FILE}"'
352 self.result.stdout = self.result.stderr = []
354 m, s = divmod(monotonic_time() - self.result.starttime, 60)
362 merged stdout and stderr), and for each test, the unmodified
363 stdout/stderr/merged in its own file.
376 pad = ' ' * (80 - (len(msga) + len(msgb)))
379 # The result line is always written to the log file. If -q was
383 write_log(bytearray(result_line, encoding='utf-8'), LOG_FILE)
390 lines = sorted(self.result.stdout + self.result.stderr,
393 # Write timestamped output (stdout and stderr) to the logfile
396 encoding='utf-8')
399 # Write the separate stdout/stderr/merged files, if the data exists
400 if len(self.result.stdout):
401 with open(os.path.join(self.outputdir, 'stdout'), 'wb') as out:
402 for _, line in self.result.stdout:
405 with open(os.path.join(self.outputdir, 'stderr'), 'wb') as err:
408 if len(self.result.stdout) and len(self.result.stderr):
409 with open(os.path.join(self.outputdir, 'merged'), 'wb') as merged:
413 with open(os.path.join(self.outputdir, 'kmemleak'), 'wb') as kmem:
483 odir = os.path.join(self.outputdir, os.path.basename(self.pre))
489 odir = os.path.join(self.outputdir, os.path.basename(self.failsafe))
493 odir = os.path.join(self.outputdir, os.path.basename(self.post))
559 if len(self.pre) and not os.path.isabs(self.pre):
560 self.pre = os.path.join(self.pathname, self.pre)
561 if len(self.post) and not os.path.isabs(self.post):
562 self.post = os.path.join(self.pathname, self.post)
563 if len(self.failsafe) and not os.path.isabs(self.failsafe):
564 self.post = os.path.join(self.pathname, self.post)
570 if f != self.failsafe and self.pathname != os.path.dirname(f):
590 if not verify_file(os.path.join(self.pathname, test)):
608 odir = os.path.join(self.outputdir, os.path.basename(self.pre))
611 odir = os.path.join(self.outputdir, os.path.basename(self.post))
622 odir = os.path.join(self.outputdir, fname)
623 test = Cmd(os.path.join(self.pathname, fname), outputdir=odir,
626 odir = os.path.join(odir, os.path.basename(self.failsafe))
652 self.outputdir = os.path.join(options.outputdir, self.timestamp)
721 if g.pre and os.path.basename(g.pre) in keeplist[group]:
727 directory, base = os.path.split(test)
742 failed = options.runfiles - set(parsed)
750 self.outputdir = os.path.join(self.outputdir, self.timestamp)
759 if os.path.isdir(sectiondir):
761 elif os.path.isdir(os.path.join(testdir, sectiondir)):
762 pathname = os.path.join(testdir, sectiondir)
766 testgroup = TestGroup(os.path.abspath(pathname),
777 os.path.join(testdir, failsafe))
795 os.path.join(testdir, failsafe))
859 components -= 1
864 tmp_dict[testfile].outputdir = os.path.join(base, uniq)
884 filename = os.path.join(self.outputdir, 'log')
898 logsymlink = os.path.join(self.outputdir, '../current')
899 if os.path.islink(logsymlink):
901 if not os.path.exists(logsymlink):
908 cmd = f'{SUDO} -c "echo scan=0 > {KMEMLEAK_FILE}"'
928 m, s = divmod(time() - self.starttime, 60)
955 os.write(sys.stdout.fileno(), bytearray(msg, encoding='utf-8'))
957 os.write(sys.stderr.fileno(), bytearray(msg, encoding='utf-8'))
968 if os.path.isdir(pathname) or os.path.islink(pathname):
973 if os.path.isfile(script_path) and os.access(script_path, os.X_OK):
984 testcmd = [SUDO, '-n', '-u', user, TRUE]
1016 if os.path.isdir(p):
1022 testrun.addtest(os.path.join(dirname, f), options)
1057 if not os.path.exists(KMEMLEAK_FILE):
1072 value = set(os.path.abspath(p) for p in value.split(','))
1077 setattr(parser.values, option.dest, os.path.abspath(value))
1084 parser.add_option('-c', action='callback', callback=options_cb,
1087 parser.add_option('-d', action='store_true', default=False, dest='dryrun',
1089 parser.add_option('-D', action='store_true', default=False, dest='debug',
1090 help='Write all test output to stdout as it arrives.')
1091 parser.add_option('-l', action='callback', callback=options_cb,
1094 help='Read logfile and re-run tests which failed.')
1095 parser.add_option('-g', action='store_true', default=False,
1097 parser.add_option('-o', action='callback', callback=options_cb,
1100 parser.add_option('-i', action='callback', callback=options_cb,
1103 parser.add_option('-K', action='store_true', default=False, dest='kmsg',
1105 parser.add_option('-m', action='callback', callback=kmemleak_cb,
1108 parser.add_option('-p', action='callback', callback=options_cb,
1111 parser.add_option('-P', action='callback', callback=options_cb,
1114 parser.add_option('-q', action='store_true', default=False, dest='quiet',
1116 parser.add_option('-s', action='callback', callback=options_cb,
1119 parser.add_option('-S', action='callback', callback=options_cb,
1123 parser.add_option('-t', action='callback', callback=options_cb, default=60,
1126 parser.add_option('-u', action='callback', callback=options_cb,
1129 parser.add_option('-w', action='callback', callback=options_cb,
1132 parser.add_option('-x', action='callback', callback=options_cb, default='',
1135 parser.add_option('-X', action='callback', callback=options_cb, default='',
1138 parser.add_option('-T', action='callback', callback=options_cb, default='',
1141 parser.add_option('-I', action='callback', callback=options_cb, default=1,
1149 options.pathnames = [os.path.abspath(path) for path in pathnames]