Commit b951e6f8 authored by Stefan Wolfsheimer's avatar Stefan Wolfsheimer
Browse files

return non-zero exit code if test fails

parent 41924260
......@@ -9,6 +9,7 @@ from testB2SafeCmd.msipidintgtest import MsiPidIntegrationTests
import argparse
import unittest
import sys
__author__ = 'lphan'
......@@ -30,42 +31,42 @@ if __name__ == '__main__':
print "Test Epicclient2 Script"
epic2_suite = unittest.TestLoader().loadTestsFromTestCase(
EpicClient2IntegrationTests)
unittest.TextTestRunner(descriptions=2, verbosity=2).run(epic2_suite)
ret = unittest.TextTestRunner(descriptions=2, verbosity=2).run(epic2_suite)
elif param.script == "msipid":
# test cases for B2safe-msipid#
print "Test msiPid Script"
msiPid_suite = unittest.TestLoader().loadTestsFromTestCase(
MsiPidIntegrationTests)
unittest.TextTestRunner(descriptions=2, verbosity=2).run(msiPid_suite)
ret = unittest.TextTestRunner(descriptions=2, verbosity=2).run(msiPid_suite)
elif param.script == "log":
# Test cases for B2Safe-LogManager#
print "Test Logging Script"
log_suite = unittest.TestSuite()
log_suite.addTest(LogManagerTestCase("test_case"))
unittest.TextTestRunner(descriptions=2, verbosity=2).run(log_suite)
ret = unittest.TextTestRunner(descriptions=2, verbosity=2).run(log_suite)
elif param.script == "auth":
# Test cases for B2Safe-AuthorzManager#
print "Test Authorization Script"
authz_suite = unittest.TestSuite()
authz_suite.addTest(AuthzManagerTestCase("test_case"))
unittest.TextTestRunner(descriptions=2, verbosity=2).run(authz_suite)
ret = unittest.TextTestRunner(descriptions=2, verbosity=2).run(authz_suite)
elif param.script == "irods":
# test cases for irods#
print "Test irods"
irods_suite = unittest.TestLoader().loadTestsFromTestCase(
IrodsIntegrationTests)
unittest.TextTestRunner(descriptions=2, verbosity=2).run(irods_suite)
ret = unittest.TextTestRunner(descriptions=2, verbosity=2).run(irods_suite)
elif param.script == "b2safe":
# test cases for irods#
print "Test b2safe"
b2safe_suite = unittest.TestLoader().loadTestsFromTestCase(
IrodsB2safeIntegrationTests)
unittest.TextTestRunner(descriptions=2, verbosity=2).run(b2safe_suite)
ret = unittest.TextTestRunner(descriptions=2, verbosity=2).run(b2safe_suite)
elif param.script == "all":
......@@ -79,7 +80,11 @@ if __name__ == '__main__':
IrodsIntegrationTests))
all_suite.addTest(unittest.TestLoader().loadTestsFromTestCase(
IrodsB2safeIntegrationTests))
unittest.TextTestRunner(descriptions=2, verbosity=2).run(all_suite)
ret = unittest.TextTestRunner(descriptions=2, verbosity=2).run(all_suite)
else:
print "Invalid Input; Valid example ./testB2SafeCmd -test epic2"
sys.exit(8)
if ret.wasSuccessful():
sys.exit(0)
else:
sys.exit(8)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment