Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/nfs4.0/testserver.py b/nfs4.0/testserver.py
- index 6eb8509..fd3e6e7 100755
- --- a/nfs4.0/testserver.py
- +++ b/nfs4.0/testserver.py
- @@ -229,6 +229,7 @@ def printflags(list):
- print s
- def main():
- + nfail = -1
- p = OptionParser("%prog SERVER:/PATH [options] flags|testcodes\n"
- " %prog --help\n"
- " %prog SHOWOPTION",
- @@ -362,18 +363,22 @@ def main():
- if opt.outfile is not None:
- pickle.dump(tests, fd, 0)
- if not clean_finish:
- - testmod.printresults(tests, opt)
- + nfail = testmod.printresults(tests, opt)
- try:
- fail = False
- env.finish()
- except Exception, e:
- fail = True
- - testmod.printresults(tests, opt)
- + nfail = testmod.printresults(tests, opt)
- if fail:
- print "\nWARNING: could not clean testdir due to:\n%s\n" % str(e)
- if opt.xmlout is not None:
- testmod.xml_printresults(tests, opt.xmlout)
- + if nfail < 0:
- + sys.exit(3)
- + if nfail > 0:
- + sys.exit(2)
- if __name__ == "__main__":
- main()
- diff --git a/nfs4.1/testmod.py b/nfs4.1/testmod.py
- index 6f114ae..ce25974 100644
- --- a/nfs4.1/testmod.py
- +++ b/nfs4.1/testmod.py
- @@ -457,6 +457,7 @@ def printresults(tests, opts, file=None):
- (sum(count[SKIP:]), len(tests))
- print >> file, "Of those: %i Skipped, %i Failed, %i Warned, %i Passed" % \
- (count[SKIP], count[FAIL], count[WARN], count[PASS])
- + return count[FAIL]
- def xml_printresults(tests, file_name, suite='all'):
- with open(file_name, 'w') as fd:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement