def log_check(self): """Check log files for consistency.""" logparse = self.params.get("logparse", "/run/tests/*/") if logparse is None or not logparse: return strict_test = False self.log.info("Parsing log path %s", self.log_path) if not os.path.exists(self.log_path): self.log.info("Path does not exist") return for filename in os.listdir(self.log_path): log_file = os.path.join(self.log_path, filename) if not os.path.isfile(log_file): self.log.info("File is a Directory. Skipping.... :%s", log_file) continue self.log.info("Parsing %s", log_file) cl = cart_logparse.LogIter(log_file) c_log_test = cart_logtest.LogTest(cl) c_log_test.check_log_file(strict_test)
def log_check(cartobj): """Check log files for consistency """ logparse = cartobj.params.get("logparse", "/run/tests/*/") if logparse is None or not logparse: return strict_test = False print("Parsing log path", cartobj.log_path) if not os.path.exists(cartobj.log_path): print("Path does not exist") return for filename in os.listdir(cartobj.log_path): log_file = os.path.join(cartobj.log_path, filename) if not os.path.isfile(log_file): print("File is a Directory. Skipping.... :", log_file) continue print("Parsing ", log_file) cl = cart_logparse.LogIter(log_file) c_log_test = cart_logtest.LogTest(cl) c_log_test.check_log_file(strict_test)