• Home
  • Raw
  • Download

Lines Matching +full:test +full:- +full:path

18     'lspci -vvn',
19 'gcc --version',
20 'ld --version',
26 'dlcservice_util --list',
75 path = os.path.join(logdir, self.logf)
76 if os.path.exists(path):
77 return utils.read_one_line(path)
92 def __init__(self, path, logf=None, log_in_keyval=False): argument
94 logf = os.path.basename(path)
96 self.path = path
101 r %= (self.path, self.logf, self.log_in_keyval)
107 return (self.path, self.logf) == (other.path, other.logf)
121 return hash((self.path, self.logf))
129 if os.path.exists(self.path):
130 if os.path.isdir(self.path):
131 dst = os.path.join(logdir, self.logf, self.path.lstrip('/'))
132 dir_util.copy_tree(self.path, dst)
134 dst = os.path.join(logdir, self.logf)
135 shutil.copyfile(self.path, dst)
147 self.cmd += ' | gzip -9'
182 if "PATH" not in env:
183 env["PATH"] = "/usr/bin:/bin"
184 logf_path = os.path.join(logdir, self.logf)
206 # pull in the post-test logs to collect
213 # pull in the EXTRA post-boot logs to collect
220 # pull in the pre test iteration logs to collect
227 logfile(fname, logf=os.path.basename(fname) + '.before'))
229 # pull in the post test iteration logs to collect
236 logfile(fname, logf=os.path.basename(fname) + '.after'))
239 self.test_loggables.add(command("df -mP", logf="df"))
243 self.test_loggables.add(command('dmesg -c',
250 self.boot_loggables.add(command('uname -a',
258 'tree /mnt/stateful_partition/var_overlay/cache/dlc-images',
268 return {"boot": self.boot_loggables, "test": self.test_loggables}
278 self.test_loggables = serialized["test"]
283 sysinfodir = os.path.join(resultsdir, "sysinfo")
284 if not os.path.exists(sysinfodir):
290 if not glob.glob(os.path.join(self.sysinfodir, "*")):
291 return -1
293 return len(glob.glob(os.path.join(self.sysinfodir, "boot.*")))
303 boot_dir = "boot.%d" % (reboot_count - 1)
304 return os.path.join(self.sysinfodir, boot_dir)
307 def _get_iteration_subdir(self, test, iteration): argument
310 logdir = os.path.join(self._get_sysinfodir(test.outputdir), iter_dir)
311 if not os.path.exists(logdir):
316 @log.log_and_ignore_errors("post-reboot sysinfo error:")
320 if not os.path.exists(logdir):
328 installed_path = os.path.join(logdir, "installed_packages")
333 @log.log_and_ignore_errors("pre-test sysinfo error:")
334 def log_before_each_test(self, test): argument
335 """Logging hook called before a test starts.
337 @param test: A test object.
340 if os.path.exists("/var/log/messages"):
355 '/usr/sbin/croslog --output=export --cursor="{}"'.format(self._system_log_cursor)),
356 logf='unified-log',
361 'journalctl -o export -c "{}"'.format(self._journal_cursor)),
366 # log some sysinfo data into the test keyval file in case system crash.
367 test_sysinfodir = self._get_sysinfodir(test.outputdir)
369 test.write_test_keyval(keyval)
371 @log.log_and_ignore_errors("post-test sysinfo error:")
372 def log_after_each_test(self, test): argument
373 """Logging hook called after a test finishs.
375 @param test: A test object.
377 test_sysinfodir = self._get_sysinfodir(test.outputdir)
379 # create a symlink in the test sysinfo dir to the current boot
381 assert os.path.exists(reboot_dir)
382 symlink_dest = os.path.join(test_sysinfodir, "reboot_current")
384 os.path.dirname(symlink_dest))
397 # log some sysinfo data into the test keyval file
399 test.write_test_keyval(keyval)
404 added_path = os.path.join(test_sysinfodir, "added_packages")
405 added_packages = "\n".join(new_packages - old_packages) + "\n"
407 removed_path = os.path.join(test_sysinfodir, "removed_packages")
408 removed_packages = "\n".join(old_packages - new_packages) + "\n"
412 @log.log_and_ignore_errors("pre-test siteration sysinfo error:")
413 def log_before_each_iteration(self, test, iteration=None): argument
414 """Logging hook called before a test iteration.
416 @param test: A test object.
417 @param iteration: A test iteration.
420 iteration = test.iteration
421 logdir = self._get_iteration_subdir(test, iteration)
432 @log.log_and_ignore_errors("post-test siteration sysinfo error:")
433 def log_after_each_iteration(self, test, iteration=None): argument
434 """Logging hook called after a test iteration.
436 @param test: A test object.
437 @param iteration: A test iteration.
440 iteration = test.iteration
441 logdir = self._get_iteration_subdir(test, iteration)
458 out_messages = open(os.path.join(logdir, "messages"), "w")
471 keyval["sysinfo-" + log.logf] = log.readline(logdir)
478 Collects keyval entries to be written in the test keyval.
480 @param test_sysinfodir: The test's system info directory.
488 self.boot_loggables, os.path.join(test_sysinfodir,
492 # Linux lpt36 2.6.18-smp-230.1 #1 [4069269] SMP Fri Oct 24 11:30:...
493 if "sysinfo-uname" in keyval:
494 kernel_vers = " ".join(keyval["sysinfo-uname"].split()[2:])
495 keyval["sysinfo-uname"] = kernel_vers
498 path = os.path.join(test_sysinfodir, "reboot_current", "meminfo")
499 if os.path.exists(path):
500 mem_data = open(path).read()
503 keyval["sysinfo-memtotal-in-kb"] = match.group(1)
506 keyval["sysinfo-phys-mbytes"] = utils.rounded_memtotal()//1024
518 @param output_dir: Path to the output directory.
530 cmd = "/usr/bin/journalctl -n0 --show-cursor -q"
533 prefix = "-- cursor: "
537 logging.error("error running journalctl --show-cursor: %s", e)
540 if not os.path.exists("/usr/sbin/croslog"):
543 cmd = "/usr/sbin/croslog --lines=0 --show-cursor --quiet"
546 prefix = "-- cursor: "
550 logging.error("error running croslog --show-cursor: %s", e)