本文整理汇总了Python中TestHelper.TestHelper.shutdown方法的典型用法代码示例。如果您正苦于以下问题:Python TestHelper.shutdown方法的具体用法?Python TestHelper.shutdown怎么用?Python TestHelper.shutdown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestHelper.TestHelper
的用法示例。
在下文中一共展示了TestHelper.shutdown方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: errorExit
# 需要导入模块: from TestHelper import TestHelper [as 别名]
# 或者: from TestHelper.TestHelper import shutdown [as 别名]
if not cluster.spreadFundsAndValidate(10):
errorExit("Failed to spread and validate funds.")
Print("Wait on cluster sync.")
if not cluster.waitOnClusterSync():
errorExit("Cluster sync wait failed.")
Print ("Relaunch dead cluster nodes instances.")
if cluster.relaunchEosInstances() is False:
errorExit("Failed to relaunch Eos instances")
Print("nodeos instances relaunched.")
Print ("Resyncing cluster nodes.")
if not cluster.waitOnClusterSync():
errorExit("Cluster never synchronized")
Print ("Cluster synched")
Print("Spread funds and validate")
if not cluster.spreadFundsAndValidate(10):
errorExit("Failed to spread and validate funds.")
Print("Wait on cluster sync.")
if not cluster.waitOnClusterSync():
errorExit("Cluster sync wait failed.")
testSuccessful=True
finally:
TestHelper.shutdown(cluster, walletMgr, testSuccessful, killEosInstances, killEosInstances, keepLogs, killAll, dumpErrorDetails)
exit(0)
示例2: errorExit
# 需要导入模块: from TestHelper import TestHelper [as 别名]
# 或者: from TestHelper.TestHelper import shutdown [as 别名]
errorExit("Cluster in bad state, received None node")
Print("Kill cluster nodes.")
cluster.killall(allInstances=killAll)
Print("Restart nodeos repeatedly to ensure dirty database flag sticks.")
timeout=3
for i in range(1,4):
Print("Attempt %d." % (i))
ret = runNodeosAndGetOutput(timeout)
assert(ret)
assert(isinstance(ret, tuple))
assert(ret[0])
assert(ret[1])
assert(isinstance(ret[1], dict))
# pylint: disable=unsubscriptable-object
stderr= ret[1]["stderr"]
retCode=ret[1]["returncode"]
assert retCode == 2, "actual return code: %s" % str(retCode)
assert("database dirty flag set" in stderr)
if debug: Print("Setting test result to success.")
testSuccessful=True
finally:
if debug: Print("Cleanup in finally block.")
TestHelper.shutdown(cluster, None, testSuccessful, killEosInstances, False, keepLogs, killAll, dumpErrorDetails)
if debug: Print("Exiting test, exit value 0.")
exit(0)