kunit.py : Exit with exit code of 1 when all tests do not pass.

Prow Presubmit determines success of presubmit job based on exit code of
script. Reporting to gerrit currently indicates a success for
failures if bad exit code is not explicitly returned.

Alternatively, this could be handled in the test script but would
depend on the output format of kunit.py and need to be adjusted
accordingly.

Change-Id: I9ef2e3ed61ff6e2bca4dcddf99380dbe0275e9dd
Signed-off-by: Avi Kondareddy <avikr@google.com>
diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py
index 7651d38..5ba3a2a 100755
--- a/tools/testing/kunit/kunit.py
+++ b/tools/testing/kunit/kunit.py
@@ -113,7 +113,9 @@
 		print_test_skeletons(cli_args)
 	elif cli_args.subcommand == 'run':
 		request = KunitRequest(cli_args.raw_output, cli_args.timeout)
-		run_tests(linux, request)
+		result = run_tests(linux, request)
+		if result.status == KunitStatus.TEST_FAILURE:
+			sys.exit(1)
 	else:
 		parser.print_help()