def process_data(self, testdir, rawiter): # the test passed iff we see the finish string passed = False for line in rawiter: if self.get_finish_string() in line: passed = True return PassFailResult(True) return PassFailResult(False)
def process_data(self, testdir, rawiter): # the test passed iff it has lines from both test_A and test_B test_A_passed = False test_B_passed = False for line in rawiter: if line.startswith(self.get_test_A_finish_string()): test_A_passed = True if line.startswith(self.get_test_B_finish_string()): test_B_passed = True if test_A_passed and test_B_passed: return PassFailResult(True) return PassFailResult(test_A_passed and test_B_passed)
def process_data(self, testdir, rawiter): # the test passed iff the last line is the finish string lastline = '' for line in rawiter: lastline = line passed = lastline.startswith(self.get_finish_string()) return PassFailResult(passed)
def process_data(self, testdir, rawiter): # the test passed iff we see the finish string passed = False for line in rawiter: if line.startswith(self.get_finish_string()): passed = True return PassFailResult(passed)
def process_data(self, testdir, rawiter): tracelogFilePath = os.path.join(self.testdir, TRACE_LOG_NAME) tracelogFile = open(tracelogFilePath, 'w') passed = None traceLogsStarted = False traceLogsFinished = False #testlog = open(os.path.join(testdir, TEST_LOG_NAME), 'r') for line in rawiter: if line.startswith('dump trac buffers: Start'): traceLogsStarted = True elif line.startswith('dump trac buffers: Stop'): traceLogsStarted = False elif traceLogsStarted: tracelogFile.write(line) passed = True #testlog.close() tracelogFile.close() print "Tracefile: " + tracelogFilePath JASONFILENAME = 'trace_defs.json' # copy trace_defs.json files jsonFilePath = os.path.join(self.build_path, "x86_64", "trace_definitions", JASONFILENAME) print "json file is at " + jsonFilePath destFile = os.path.join(self.testdir, JASONFILENAME) copyfile(jsonFilePath, destFile) return PassFailResult(passed == True)
def process_data(self, testdir, rawiter): # the test passed if no error occurred passed = 3 for line in rawiter: if "DIGITS == " in line: passed += 1 return PassFailResult(passed == 255)
def process_data(self, testdir, rawiter): passed = False for line in rawiter: if self._filecontents in line: passed = True return PassFailResult(passed)
def process_data(self, testdir, rawiter): passed = False for line in rawiter: if line.startswith(self.get_finish_string()): passed = True break return PassFailResult(passed)
def process_data(self, testdir, rawiter): debug.verbose(">> processing data") # the test passed if we can produce results results = RowResults(['op', 'cycles/iter', '#iters']) # and assertions are disabled valid = False for line in rawiter: if line.startswith('Operating system bug'): valid = False break if 'ASSERTIONS DISABLED' in line: valid = True #if line.startswith(self.get_finish_string()): # break if line.startswith("appel_li:"): # found data line: <op cycles/iter #iters> elems = line.strip().split(':') if len(elems) < 3: continue _, op, data = elems if ' ' not in data: continue cyc, _, count, _ = data.strip().split(' ') results.add_row([op.strip(), cyc, count]) if not valid: return PassFailResult(False) return results
def process_data(self, testdir, rawiter): output_count = 0 for line in rawiter: if ("On core %s" % self.core) in line: output_count = output_count + 1 return PassFailResult(output_count > 1)
def process_data(self, testdir, rawiter): # the test passed iff we see at least one PASS and no FAILs in the log passed = None try: testlog = open(os.path.join(testdir, TEST_LOG_NAME), 'r') except IOError as e: debug.verbose("Cannot find test log, failing test") return PassFailResult(False, reason="Cannot find test log") for line in testlog: if re.match('Test:.*FAIL$', line): passed = False elif passed != False and re.match('Test:.*PASS$', line): passed = True testlog.close() server_ok = super(WebserverTest, self).passed() return PassFailResult(passed and server_ok)
def process_data(self, testdir, rawiter): self.regex = re.compile(self.REGEX) matches = 0 for line in rawiter: match = self.regex.match(line) if match: matches += 1 if matches == self.TESTS: return PassFailResult(True) elif matches < self.TESTS: return PassFailResult(False, "Some block/buffer size checks did not report back with SUCCESS.") elif matches > self.TESTS: return PassFailResult(False, "Got more SUCCESS lines than expected. If you changed the test you may need to increase self.TESTS.") else: assert "Should not come here"
def process_data(self, testdir, rawiter): nspawned = nseen = 0 for line in rawiter: if re.match(r'.*pawning .*memtest on core', line): nspawned += 1 if line.startswith("memtest passed successfully!"): nseen += 1 return PassFailResult(nspawned == nseen)
def process_data(self, testdir, rawiter): # the test passed iff the last line is the finish string passed = False for line in rawiter: if line.startswith(self.get_finish_string()): _, _, results = line.split(':') results = results.strip() passed = results == "0" return PassFailResult(passed)
def process_data(self, testdir, rawiter): # the test passed iff the last line is the finish string passed = False for line in rawiter: if line.startswith(self.get_finish_string()): results = line.split(':') results = map(str.strip, results) passed = "passed" in results return PassFailResult(passed)
def process_data(self, testdir, rawiter): found_kcb_output = False found_cpu_output = False for line in rawiter: if "KCB 0:" in line: found_kcb_output = True if "CPU 0:" in line: found_cpu_output = True return PassFailResult(found_kcb_output and found_cpu_output)
def process_data(self, testdir, rawiter): # the test passed iff we do not find a line matching the given # error regex error_re = re.compile(error_regex) passed = True for line in rawiter: if error_re.match(line): passed = False return PassFailResult(passed)
def process_data(self, testdir, raw_iter): # check the first line to see if the test actually ran try: firstline = raw_iter.next() if firstline.startswith('Test skipped'): return PassFailResult(True) except StopIteration: # empty results file return PassFailResult(False) # process the rest of the file results = {} data = {} index = {} iteration = {} results['Data'] = RawResults('iter', name='dcache') results['Instruction'] = RawResults('iter', name='icache') for cache in ['Data', 'Instruction']: data[cache] = [] index[cache] = None iteration[cache] = 1 for line in raw_iter: m = re.match( "(Data|Instruction) cache miss\s+(\d+)\s+(\d+)\s+(\d+)", line) if m: cache = m.group(1) i = int(m.group(2)) value = int(m.group(4)) - int(m.group(3)) if index[cache] is not None and i < index[ cache]: # new iteration results[cache].add_group(iteration[cache], data[cache]) iteration[cache] += 1 data[cache] = [value] else: data[cache].append(value) index[cache] = i ret = [] for cache in ['Data', 'Instruction']: results[cache].add_group(iteration[cache], data[cache]) ret.append(results[cache]) return ret
def process_data(self, testdir, rawiter): output_count = 0 parked_count = 0 for line in rawiter: if ("On core %s" % self.parking_core) in line: parked_count = parked_count + 1 if ("On core %s" % self.core) in line: output_count = output_count + 1 return PassFailResult(parked_count >= 2 and output_count >= 4)
def process_data(self, testdir, rawiter): # the test passed iff we see at least one PASS and no FAILs in the log passed = None testlog = open(os.path.join(testdir, TEST_LOG_NAME), 'r') for line in testlog: if re.match('Test:.*FAIL$', line): passed = False elif passed != False and re.match('Test:.*PASS$', line): passed = True testlog.close() return PassFailResult(passed == True)
def process_data(self, testdir, rawiter): # the test passed iff the last line is the finish string lastline = '' passed = False; phi_up_count = 0 for line in rawiter: m = re.search("Xeon Phi operational: xeon_phi." + str(self.nphi - 1) + ".ready", line) if m: phi_count_up = phi_count_up + 1 return PassFailResult(phi_count_up == self.nphi)
def process_data(self, testdir, rawiter): # the test passed iff the last line is the finish string lastline = '' passed = False; for line in rawiter: if line.startswith(self.get_finish_string()) : passed = True; break; elif line.startswith("Aborted") : passed = False; break; return PassFailResult(passed)
def process_data(self, testdir, rawiter): # the test passed iff the last line is the finish string print "PROCESS DATA" passed = False for line in rawiter: m = re.search( "Xeon Phi operational: xeon_phi." + str(self.nphi - 1) + ".ready", line) if m: passed = True return PassFailResult(passed)
def process_data(self, testdir, rawiter): passed = True for line in rawiter: if "user page fault in" in line: passed = False break if "user trap #" in line: passed = False break if "PANIC! kernel assertion" in line: passed = False return PassFailResult(passed)
def process_data(self, testdir, rawiter): # the test passed iff we do not find a line matching the given # error regex error_re = re.compile(error_regex) passed = True found_test = False for line in rawiter: if error_re.match(line): passed = False if self.get_finish_string() in line: found_test = True return PassFailResult(found_test and passed)
def process_data(self, testdir, rawiter): # the test passed iff the last line is the finish string nspawned = 0 npassed = 0 for line in rawiter: if re.match(r'.*pawning .*test_retype on core', line): nspawned += 1 if line.startswith("retype: result:"): _, _, r = line.split(':') r = r.strip() if r == "0": npassed += 1 return PassFailResult(npassed == nspawned)
def process_data(self, testdir, rawiter): sleeper = False num_wait = 0 for line in rawiter: if line.startswith("Unblocked") and sleeper: num_wait += 1 sleeper = False else: sleeper = False if line.startswith("Sleeper exit"): sleeper = True if line.startswith("Failed"): return PassFailResult(False) if num_wait == 2: return PassFailResult(True) else: return PassFailResult(False)
def process_data(self, testdir, rawiter): nspawned = 0 for line in rawiter: if re.match(MATCH, line): nspawned += 1 return PassFailResult(nspawned == (NUM_SPAWNS + 1))
def process_data(self, testdir, rawiter): result = True for line in rawiter: if re.match('kernel [0-9]*: user page fault WHILE DISABLED', line): result = False return PassFailResult(result)
def process_data(self, testdir, rawiter): result = False for line in rawiter: if re.search('SPAN_TEST_SUCCESS.', line): result = True return PassFailResult(result)