Lines Matching +full:os +full:- +full:initiated

2 # SPDX-License-Identifier: CDDL-1.0
22 import os
38 from os.path import exists
68 raise OSError(errno_, os.strerror(errno_))
69 return t.tv_sec + t.tv_nsec * 1e-9
90 m, s = divmod(monotonic_time() - self.starttime, 60)
142 buf = os.read(fd, 4096)
146 os.write(sys.stderr.fileno(), buf)
168 The timeout for tests is measured in wall-clock time
195 signal = '-TERM'
208 If this is not a user-initiated kill and the test has not been
214 runtime = monotonic_time() - self.result.starttime
227 me = getpwuid(os.getuid())
230 if os.path.isfile(cmd+'.ksh') and os.access(cmd+'.ksh', os.X_OK):
232 if os.path.isfile(cmd+'.sh') and os.access(cmd+'.sh', os.X_OK):
236 if not os.path.isfile(cmd):
237 if os.path.isfile(cmd+'.ksh') and os.access(cmd+'.ksh', os.X_OK):
239 if os.path.isfile(cmd+'.sh') and os.access(cmd+'.sh', os.X_OK):
244 tmpdir = os.getenv('TMPDIR')
250 ret = '%s -E -u %s %s %s' % (SUDO, user, tmpdirarg, cmd)
288 old = os.umask(0)
289 if not os.path.isdir(self.outputdir):
290 os.makedirs(self.outputdir, mode=0o777)
291 os.umask(old)
301 kp = Popen([SUDO, "sh", "-c",
313 kp = Popen([SUDO, "sh", "-c",
322 cmd = f'{SUDO} sh -c "echo clear > {KMEMLEAK_FILE}"'
341 cmd = f'{SUDO} sh -c "echo scan > {KMEMLEAK_FILE}"'
363 m, s = divmod(monotonic_time() - self.result.starttime, 60)
375 logname = getpwuid(os.getuid()).pw_name
385 pad = ' ' * (80 - (len(msga) + len(msgb)))
388 # The result line is always written to the log file. If -q was
392 write_log(bytearray(result_line, encoding='utf-8'), LOG_FILE)
405 encoding='utf-8')
410 with open(os.path.join(self.outputdir, 'stdout'), 'wb') as out:
412 os.write(out.fileno(), b'%s\n' % line)
414 with open(os.path.join(self.outputdir, 'stderr'), 'wb') as err:
416 os.write(err.fileno(), b'%s\n' % line)
418 with open(os.path.join(self.outputdir, 'merged'), 'wb') as merged:
420 os.write(merged.fileno(), b'%s\n' % line)
422 with open(os.path.join(self.outputdir, 'kmemleak'), 'wb') as kmem:
492 odir = os.path.join(self.outputdir, os.path.basename(self.pre))
498 odir = os.path.join(self.outputdir, os.path.basename(self.failsafe))
502 odir = os.path.join(self.outputdir, os.path.basename(self.post))
568 if len(self.pre) and not os.path.isabs(self.pre):
569 self.pre = os.path.join(self.pathname, self.pre)
570 if len(self.post) and not os.path.isabs(self.post):
571 self.post = os.path.join(self.pathname, self.post)
572 if len(self.failsafe) and not os.path.isabs(self.failsafe):
573 self.post = os.path.join(self.pathname, self.post)
579 if f != self.failsafe and self.pathname != os.path.dirname(f):
599 if not verify_file(os.path.join(self.pathname, test)):
617 odir = os.path.join(self.outputdir, os.path.basename(self.pre))
620 odir = os.path.join(self.outputdir, os.path.basename(self.post))
631 odir = os.path.join(self.outputdir, fname)
632 test = Cmd(os.path.join(self.pathname, fname), outputdir=odir,
635 odir = os.path.join(odir, os.path.basename(self.failsafe))
661 self.outputdir = os.path.join(options.outputdir, self.timestamp)
730 if g.pre and os.path.basename(g.pre) in keeplist[group]:
736 directory, base = os.path.split(test)
751 failed = options.runfiles - set(parsed)
760 setattr(self, opt, os.path.join(outputdir, self.timestamp))
771 if os.path.isdir(sectiondir):
773 elif os.path.isdir(os.path.join(testdir, sectiondir)):
774 pathname = os.path.join(testdir, sectiondir)
778 testgroup = TestGroup(os.path.abspath(pathname),
789 os.path.join(testdir, failsafe))
793 os.path.join(outputdir,
812 os.path.join(testdir, failsafe))
816 os.path.join(outputdir,
876 base = os.path.join(self.outputdir, 'output')
895 uniq = path.split('/', cut)[-1]
896 alltests[path].outputdir = os.path.join(base, uniq)
910 old = os.umask(0)
911 os.makedirs(self.outputdir, mode=0o777)
912 os.umask(old)
913 filename = os.path.join(self.outputdir, 'log')
923 os.chdir(self.outputdir)
927 logsymlink = os.path.join(self.outputdir, '../current')
928 if os.path.islink(logsymlink):
929 os.unlink(logsymlink)
930 if not os.path.exists(logsymlink):
931 os.symlink(self.outputdir, logsymlink)
937 cmd = f'{SUDO} -c "echo scan=0 > {KMEMLEAK_FILE}"'
957 m, s = divmod(time() - self.starttime, 60)
984 os.write(sys.stdout.fileno(), bytearray(msg, encoding='utf-8'))
986 os.write(sys.stderr.fileno(), bytearray(msg, encoding='utf-8'))
988 os.write(LOG_FILE_OBJ.fileno(), msg)
997 if os.path.isdir(pathname) or os.path.islink(pathname):
1002 if os.path.isfile(script_path) and os.access(script_path, os.X_OK):
1013 testcmd = [SUDO, '-n', '-u', user, TRUE]
1045 if os.path.isdir(p):
1046 for dirname, _, filenames in os.walk(p):
1051 testrun.addtest(os.path.join(dirname, f), options)
1086 if not os.path.exists(KMEMLEAK_FILE):
1101 value = set(os.path.abspath(p) for p in value.split(','))
1106 setattr(parser.values, option.dest, os.path.abspath(value))
1113 parser.add_option('-c', action='callback', callback=options_cb,
1116 parser.add_option('-d', action='store_true', default=False, dest='dryrun',
1118 parser.add_option('-D', action='store_true', default=False, dest='debug',
1120 parser.add_option('-l', action='callback', callback=options_cb,
1123 help='Read logfile and re-run tests which failed.')
1124 parser.add_option('-g', action='store_true', default=False,
1126 parser.add_option('-o', action='callback', callback=options_cb,
1129 parser.add_option('-i', action='callback', callback=options_cb,
1132 parser.add_option('-K', action='store_true', default=False, dest='kmsg',
1134 parser.add_option('-m', action='callback', callback=kmemleak_cb,
1137 parser.add_option('-p', action='callback', callback=options_cb,
1140 parser.add_option('-P', action='callback', callback=options_cb,
1143 parser.add_option('-q', action='store_true', default=False, dest='quiet',
1145 parser.add_option('-s', action='callback', callback=options_cb,
1148 parser.add_option('-S', action='callback', callback=options_cb,
1152 parser.add_option('-t', action='callback', callback=options_cb, default=60,
1155 parser.add_option('-u', action='callback', callback=options_cb,
1158 parser.add_option('-w', action='callback', callback=options_cb,
1161 parser.add_option('-x', action='callback', callback=options_cb, default='',
1164 parser.add_option('-X', action='callback', callback=options_cb, default='',
1167 parser.add_option('-T', action='callback', callback=options_cb, default='',
1170 parser.add_option('-I', action='callback', callback=options_cb, default=1,
1178 options.pathnames = [os.path.abspath(path) for path in pathnames]