minor comment updates

This commit is contained in:
tsk-build 2014-09-16 10:29:29 -04:00
parent 9d5db3081a
commit dfe6ebcf7d

View File

@ -121,6 +121,7 @@ def main():
elif SYS is OS.WIN: elif SYS is OS.WIN:
theproc = subprocess.Popen(antin, shell = True, stdout=subprocess.PIPE) theproc = subprocess.Popen(antin, shell = True, stdout=subprocess.PIPE)
theproc.communicate() theproc.communicate()
# Otherwise test away! # Otherwise test away!
TestRunner.run_tests(test_config) TestRunner.run_tests(test_config)
@ -134,10 +135,13 @@ class TestRunner(object):
Executes the AutopsyIngest for each image and dispatches the results based on Executes the AutopsyIngest for each image and dispatches the results based on
the mode (rebuild or testing) the mode (rebuild or testing)
""" """
# get list of test images to process
test_data_list = [ TestData(image, test_config) for image in test_config.images ] test_data_list = [ TestData(image, test_config) for image in test_config.images ]
Reports.html_add_images(test_config.html_log, test_config.images) Reports.html_add_images(test_config.html_log, test_config.images)
# Test each image
logres =[] logres =[]
for test_data in test_data_list: for test_data in test_data_list:
Errors.clear_print_logs() Errors.clear_print_logs()
@ -146,12 +150,16 @@ class TestRunner(object):
Errors.print_error(msg) Errors.print_error(msg)
Errors.print_error(test_data.gold_archive) Errors.print_error(test_data.gold_archive)
continue continue
# Analyze the given image
TestRunner._run_autopsy_ingest(test_data) TestRunner._run_autopsy_ingest(test_data)
# Either copy the data or compare the data
if test_config.args.rebuild: if test_config.args.rebuild:
TestRunner.rebuild(test_data) TestRunner.rebuild(test_data)
else: else:
logres.append(TestRunner._run_test(test_data)) logres.append(TestRunner._compare_results(test_data))
test_data.printout = Errors.printout test_data.printout = Errors.printout
test_data.printerror = Errors.printerror test_data.printerror = Errors.printerror
# give solr process time to die. # give solr process time to die.
@ -206,8 +214,8 @@ class TestRunner(object):
TestRunner._handle_solr(test_data) TestRunner._handle_solr(test_data)
TestRunner._handle_exception(test_data) TestRunner._handle_exception(test_data)
#TODO: figure out return type of _run_test (logres) #TODO: figure out return type of _compare_results(logres)
def _run_test(test_data): def _compare_results(test_data):
"""Compare the results of the output to the gold standard. """Compare the results of the output to the gold standard.
Args: Args:
@ -216,12 +224,15 @@ class TestRunner(object):
Returns: Returns:
logres? logres?
""" """
# Unzip the gold file
TestRunner._extract_gold(test_data) TestRunner._extract_gold(test_data)
# Look for core exceptions # Look for core exceptions
# @@@ Should be moved to TestResultsDiffer, but it didn't know about logres -- need to look into that # @@@ Should be moved to TestResultsDiffer, but it didn't know about logres -- need to look into that
logres = Logs.search_common_log("TskCoreException", test_data) logres = Logs.search_common_log("TskCoreException", test_data)
# Compare output with gold and display results
TestResultsDiffer.run_diff(test_data) TestResultsDiffer.run_diff(test_data)
print("Html report passed: ", test_data.html_report_passed) print("Html report passed: ", test_data.html_report_passed)
print("Errors diff passed: ", test_data.errors_diff_passed) print("Errors diff passed: ", test_data.errors_diff_passed)
@ -251,6 +262,7 @@ class TestRunner(object):
Errors.add_errors_out(test_data.common_log_path) Errors.add_errors_out(test_data.common_log_path)
return logres return logres
def _extract_gold(test_data): def _extract_gold(test_data):
"""Extract gold archive file to output/gold/tmp/ """Extract gold archive file to output/gold/tmp/