提交 a9dd6053 编写于 作者: C Ciju John

Fix and enable test nodeos_run_remote_test.

上级 7ec375fc
......@@ -39,7 +39,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/consensus-validation-malicious-produc
#To run plugin_test with all log from blockchain displayed, put --verbose after --, i.e. plugin_test -- --verbose
add_test(NAME plugin_test COMMAND plugin_test --report_level=detailed --color_output)
add_test(NAME nodeos_run_test COMMAND tests/nodeos_run_test.py -v --only-bios --dump-error-detail WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
# TODO removed on slim: add_test(NAME nodeos_run_remote_test COMMAND tests/nodeos_run_remote_test.py -v --dump-error-detail WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME nodeos_run_remote_test COMMAND tests/nodeos_run_remote_test.py -v --only-bios --dump-error-detail WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
# TODO removed on slim: add_test(NAME p2p_dawn515_test COMMAND tests/p2p_tests/dawn_515/test.sh WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
#if(BUILD_MONGO_DB_PLUGIN)
# add_test(NAME nodeos_run_test-mongodb COMMAND tests/nodeos_run_test.py --mongodb -v --dump-error-detail WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
......
......@@ -14,6 +14,7 @@ def errorExit(msg="", errorCode=1):
parser = argparse.ArgumentParser()
parser.add_argument("-v", help="verbose", action='store_true')
parser.add_argument("--dont-kill", help="Leave cluster running after test finishes", action='store_true')
parser.add_argument("--only-bios", help="Limit testing to bios node.", action='store_true')
parser.add_argument("--dump-error-details",
help="Upon error print etc/eosio/node_*/config.ini and var/lib/node_*/stderr.log to stdout",
action='store_true')
......@@ -22,6 +23,7 @@ args = parser.parse_args()
debug=args.v
dontKill=args.dont_kill
dumpErrorDetails=args.dump_error_details
onlyBios=args.only_bios
testUtils.Utils.Debug=debug
......@@ -43,7 +45,7 @@ try:
Print ("producing nodes: %s, non-producing nodes: %d, topology: %s, delay between nodes launch(seconds): %d" %
(pnodes, total_nodes-pnodes, topo, delay))
Print("Stand up cluster")
if cluster.launch(pnodes, total_nodes, prodCount, topo, delay) is False:
if cluster.launch(pnodes, total_nodes, prodCount, topo, delay, onlyBios=onlyBios, dontKill=dontKill) is False:
errorExit("Failed to stand up eos cluster.")
Print ("Wait for Cluster stabilization")
......@@ -55,15 +57,19 @@ try:
initaPrvtKey=producerKeys["inita"]["private"]
initbPrvtKey=producerKeys["initb"]["private"]
cmd="%s --dont-launch --inita_prvt_key %s --initb_prvt_key %s %s %s" % (actualTest, initaPrvtKey, initbPrvtKey, "-v" if debug else "", "--dont-kill" if dontKill else "")
cmd="%s --dont-launch --inita_prvt_key %s --initb_prvt_key %s %s %s %s" % (actualTest, initaPrvtKey, initbPrvtKey, "-v" if debug else "", "--dont-kill" if dontKill else "", "--only-bios" if onlyBios else "")
Print("Starting up %s test: %s" % ("nodeos", actualTest))
Print("cmd: %s\n" % (cmd))
if 0 != subprocess.call(cmd, shell=True):
errorExit("failed to run cmd.")
testSuccessful=True
Print("\nEND")
finally:
if testSuccessful:
Print("Test succeeded.")
else:
Print("Test failed.")
if not testSuccessful and dumpErrorDetails:
cluster.dumpErrorDetails()
Print("== Errors see above ==")
......
......@@ -1303,7 +1303,9 @@ class Cluster(object):
return True
# Initialize the default nodes (at present just the root node)
def initializeNodes(self, initaPrvtKey=None, initbPrvtKey=None):
def initializeNodes(self, initaPrvtKey=None, initbPrvtKey=None, onlyBios=False):
port=Cluster.__BiosPort if onlyBios else self.port
host=Cluster.__BiosHost if onlyBios else self.host
node=Node(self.host, self.port, enableMongo=self.enableMongo, mongoHost=self.mongoHost, mongoPort=self.mongoPort, mongoDb=self.mongoDb)
node.setWalletEndpointArgs(self.walletEndpointArgs)
if Utils.Debug: Utils.Print("Node:", node)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册