summaryrefslogtreecommitdiffstats
path: root/tests/test-runner/cmd
diff options
context:
space:
mode:
authorAlek P <[email protected]>2017-06-30 14:14:26 -0400
committerBrian Behlendorf <[email protected]>2017-06-30 11:14:26 -0700
commitfe46eebe6b6f75a006a295db1f14c9c9f02751c1 (patch)
treeb61906aeecae8c44c0d2cb8edfe37db808d56a3f /tests/test-runner/cmd
parentb81a1c61ec6c70586e56d29b66b261dadf1d4fe8 (diff)
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 <[email protected]> Reviewed-by: George Melikov <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Signed-off-by: Alek Pinchuk <[email protected]> Closes #6285
Diffstat (limited to 'tests/test-runner/cmd')
-rwxr-xr-xtests/test-runner/cmd/test-runner.py10
1 files 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__':