From fe46eebe6b6f75a006a295db1f14c9c9f02751c1 Mon Sep 17 00:00:00 2001 From: Alek P Date: Fri, 30 Jun 2017 14:14:26 -0400 Subject: [PATCH] On failure tests-runner should do non-zero exit Right now test runner will always exit(0). It's helpful to have zfs-tests.sh provide different exit values depending on if everything passed or not. We can then use common shell cmds to run tests until failure. Reviewed-by: Brian Behlendorf Reviewed-by: George Melikov Reviewed-by: Giuseppe Di Natale Signed-off-by: Alek Pinchuk Closes #6285 --- tests/test-runner/cmd/test-runner.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/test-runner/cmd/test-runner.py b/tests/test-runner/cmd/test-runner.py index 291ffa7bd..be2de403b 100755 --- a/tests/test-runner/cmd/test-runner.py +++ b/tests/test-runner/cmd/test-runner.py @@ -13,6 +13,7 @@ # # Copyright (c) 2012, 2015 by Delphix. All rights reserved. +# Copyright (c) 2017 Datto Inc. # import ConfigParser @@ -702,7 +703,7 @@ class TestRun(object): def summary(self): if Result.total is 0: - return + return 2 print '\nResults Summary' for key in Result.runresults.keys(): @@ -716,6 +717,10 @@ class TestRun(object): float(Result.total)) * 100) print 'Log directory:\t%s' % self.outputdir + if Result.runresults['FAIL'] > 0: + return 1 + return 0 + def verify_file(pathname): """ @@ -871,8 +876,7 @@ def main(): testrun.complete_outputdirs() testrun.run(options) - testrun.summary() - exit(0) + exit(testrun.summary()) if __name__ == '__main__':