35 successful_bringup_count = 0
36 successful_shutdown_count = 0
37 for line
in log.readlines():
38 if line.startswith(
'======= START OF RUN:'):
39 test_successful =
True
40 shutdown_successful =
False
41 bringup_successful =
False
43 if line.startswith(
'======== END OF RUN:'):
46 if bringup_successful:
47 successful_bringup_count += 1
48 conclusion =
' but bringup was successful'
49 if shutdown_successful:
50 successful_shutdown_count += 1
51 conclusion =
' but shutdown was successful'
52 if not test_successful:
54 print(
'Failure in test ', test_count, conclusion)
57 test_successful =
False
59 if 'The system is active' in line:
60 bringup_successful =
True
62 if 'The system has been successfully shut down' in line:
63 shutdown_successful =
True
65 print(
'Number of tests: ', test_count)
66 print(
'Number of successes: ', test_count - fail_count)
67 print(
'Number of successful bringups', successful_bringup_count)
68 print(
'Number of successful shutdowns', successful_shutdown_count)
71 if __name__ ==
'__main__':