]> git.proxmox.com Git - mirror_zfs.git/commitdiff
On failure tests-runner should do non-zero exit
authorAlek P <alek-p@users.noreply.github.com>
Fri, 30 Jun 2017 18:14:26 +0000 (14:14 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 30 Jun 2017 18:14:26 +0000 (11:14 -0700)
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 <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Alek Pinchuk <apinchuk@datto.com>
Closes #6285

tests/test-runner/cmd/test-runner.py

index 291ffa7bdd11abe85fc46cd2b204e54a75843c3a..be2de403bee9c4f7e2f82f58958d1fa45de4946f 100755 (executable)
@@ -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__':