Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/test_framework.py
Show First 20 Lines • Show All 139 Lines • ▼ Show 20 Lines | def main(self): | ||||
try: | try: | ||||
if self.options.usecli and not self.supports_cli: | if self.options.usecli and not self.supports_cli: | ||||
raise SkipTest( | raise SkipTest( | ||||
"--usecli specified but test does not support using CLI") | "--usecli specified but test does not support using CLI") | ||||
self.setup_chain() | self.setup_chain() | ||||
self.setup_network() | self.setup_network() | ||||
self.run_test() | self.run_test() | ||||
success = TestStatus.PASSED | success = TestStatus.PASSED | ||||
except JSONRPCException as e: | except JSONRPCException: | ||||
self.log.exception("JSONRPC error") | self.log.exception("JSONRPC error") | ||||
except SkipTest as e: | except SkipTest as e: | ||||
self.log.warning("Test Skipped: {}".format(e.message)) | self.log.warning("Test Skipped: {}".format(e.message)) | ||||
success = TestStatus.SKIPPED | success = TestStatus.SKIPPED | ||||
except AssertionError as e: | except AssertionError: | ||||
self.log.exception("Assertion failed") | self.log.exception("Assertion failed") | ||||
except KeyError as e: | except KeyError: | ||||
self.log.exception("Key error") | self.log.exception("Key error") | ||||
except Exception as e: | except Exception: | ||||
self.log.exception("Unexpected exception caught during testing") | self.log.exception("Unexpected exception caught during testing") | ||||
except KeyboardInterrupt as e: | except KeyboardInterrupt: | ||||
self.log.warning("Exiting after keyboard interrupt") | self.log.warning("Exiting after keyboard interrupt") | ||||
if success == TestStatus.FAILED and self.options.pdbonfailure: | if success == TestStatus.FAILED and self.options.pdbonfailure: | ||||
print("Testcase failed. Attaching python debugger. Enter ? for help") | print("Testcase failed. Attaching python debugger. Enter ? for help") | ||||
pdb.set_trace() | pdb.set_trace() | ||||
if not self.options.noshutdown: | if not self.options.noshutdown: | ||||
self.log.info("Stopping nodes") | self.log.info("Stopping nodes") | ||||
▲ Show 20 Lines • Show All 338 Lines • Show Last 20 Lines |