diff --git a/scripts/tests/test_app.py b/scripts/tests/test_app.py index 7aac513c0a..6ad860dc32 100755 --- a/scripts/tests/test_app.py +++ b/scripts/tests/test_app.py @@ -28,6 +28,9 @@ def run(command, hypervisor_name, image_path=None, line=None, guest_port=None, h app.join() + print('----------') + print('SUCCESS') + if __name__ == "__main__": parser = argparse.ArgumentParser(prog='test_app') parser.add_argument("-i", "--image", action="store", default=None, metavar="IMAGE", diff --git a/scripts/tests/test_app_with_test_script.py b/scripts/tests/test_app_with_test_script.py index 1cc22fda22..aa9733578f 100755 --- a/scripts/tests/test_app_with_test_script.py +++ b/scripts/tests/test_app_with_test_script.py @@ -15,8 +15,6 @@ def run(command, hypervisor_name, host_port, guest_port, script_path, image_path print("-----------------------------------") script_out = runpy.run_path(script_path) - print("-----------------------------------") - print("Success: %s" % script_out['success']) if end_line != None: wait_for_line_contains(app, end_line) @@ -24,6 +22,12 @@ def run(command, hypervisor_name, host_port, guest_port, script_path, image_path app.kill() app.join() + print("-----------------------------------") + if script_out['success'] == True: + print("SUCCESS") + else: + print("FAILURE") + if __name__ == "__main__": parser = argparse.ArgumentParser(prog='test_app') parser.add_argument("-i", "--image", action="store", default=None, metavar="IMAGE", diff --git a/scripts/tests/test_http_app_with_curl_and_ab.py b/scripts/tests/test_http_app_with_curl_and_ab.py index 84dc6b0311..884fe79227 100755 --- a/scripts/tests/test_http_app_with_curl_and_ab.py +++ b/scripts/tests/test_http_app_with_curl_and_ab.py @@ -58,6 +58,7 @@ def run(command, hypervisor_name, host_port, guest_port, http_path, expected_htt if expected_http_line != None: check_with_curl(app_url, expected_http_line) + success = True try: app.kill() app.join() @@ -66,12 +67,19 @@ def run(command, hypervisor_name, host_port, guest_port, http_path, expected_htt print("Ignorring error from guest on kill: %s" % app.line_with_error()) else: print("ERROR: Guest failed on kill() or join(): %s" % str(ex)) + success = False if failed_requests > 0: print("FAILED ab - encountered failed requests: %d" % failed_requests) + success = False if complete_requests < count: print("FAILED ab - too few complete requests : %d ? %d" % (complete_requests, count)) + success = False + + if success: + print('----------') + print('SUCCESS') if __name__ == "__main__": parser = argparse.ArgumentParser(prog='test_app')