From 0d8e28a171203760d836f2cfc05745f0dc2f6468 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Thu, 27 Oct 2016 15:29:26 -0700 Subject: [PATCH] calsoft.py: fix error reporting Report all of the tests that failed (and remove some overly fancy Python magic that didn't work anyway). Change-Id: I4ee47e845fe4727c69f84b505ea5ae19a15a9270 Signed-off-by: Daniel Verkamp --- test/iscsi_tgt/calsoft/calsoft.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/iscsi_tgt/calsoft/calsoft.py b/test/iscsi_tgt/calsoft/calsoft.py index c473a066e..62a5a6ba9 100755 --- a/test/iscsi_tgt/calsoft/calsoft.py +++ b/test/iscsi_tgt/calsoft/calsoft.py @@ -98,9 +98,13 @@ def main(): exit(1) with open(output_file, 'w') as f: json.dump(obj=result, fp=f, indent=2) - if any(["FAIL" == x["Result"] for x in case_result_list]): - print "Test case %s failed." % (x["Name"]) - sys.exit(1) + + failed = 0 + for x in case_result_list: + if x["Result"] == "FAIL": + print "Test case %s failed." % (x["Name"]) + failed = 1 + exit(failed) if __name__ == '__main__': main()