本文整理汇总了Python中TestHelper.TestHelper.parse_args方法的典型用法代码示例。如果您正苦于以下问题:Python TestHelper.parse_args方法的具体用法?Python TestHelper.parse_args怎么用?Python TestHelper.parse_args使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestHelper.TestHelper
的用法示例。
在下文中一共展示了TestHelper.parse_args方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: errorExit
# 需要导入模块: from TestHelper import TestHelper [as 别名]
# 或者: from TestHelper.TestHelper import parse_args [as 别名]
# --kill-sig <kill signal [term|kill]>
# --kill-count <nodeos instances to kill>
# --dont-kill <Leave cluster running after test finishes>
# --dump-error-details <Upon error print etc/eosio/node_*/config.ini and var/lib/node_*/stderr.log to stdout>
# --keep-logs <Don't delete var/lib/node_* folders upon test completion>
###############################################################
Print=testUtils.Utils.Print
def errorExit(msg="", errorCode=1):
Print("ERROR:", msg)
traceback.print_stack(limit=-1)
exit(errorCode)
args=TestHelper.parse_args({"-p","-d","-s","-c","--kill-sig","--kill-count","--keep-logs","--p2p-plugin"
,"--dump-error-details","-v","--leave-running","--clean-run"})
pnodes=args.p
topo=args.s
delay=args.d
chainSyncStrategyStr=args.c
debug=args.v
total_nodes = pnodes
killCount=args.kill_count if args.kill_count > 0 else 1
killSignal=args.kill_sig
killEosInstances= not args.leave_running
dumpErrorDetails=args.dump_error_details
keepLogs=args.keep_logs
killAll=args.clean_run
p2pPlugin=args.p2p_plugin
seed=1
示例2: errorExit
# 需要导入模块: from TestHelper import TestHelper [as 别名]
# 或者: from TestHelper.TestHelper import parse_args [as 别名]
import random
import subprocess
import signal
###############################################################
# Test for validating the dirty db flag sticks repeated nodeos restart attempts
###############################################################
Print=Utils.Print
def errorExit(msg="", errorCode=1):
Print("ERROR:", msg)
exit(errorCode)
args = TestHelper.parse_args({"--keep-logs","--dump-error-details","-v","--leave-running","--clean-run"})
debug=args.v
pnodes=1
topo="mesh"
delay=1
chainSyncStrategyStr=Utils.SyncResyncTag
total_nodes = pnodes
killCount=1
killSignal=Utils.SigKillTag
killEosInstances= not args.leave_running
dumpErrorDetails=args.dump_error_details
keepLogs=args.keep_logs
killAll=args.clean_run
seed=1
示例3: errorExit
# 需要导入模块: from TestHelper import TestHelper [as 别名]
# 或者: from TestHelper.TestHelper import parse_args [as 别名]
import subprocess
###############################################################
# nodeos_run_remote_test
# Tests remote capability of the nodeos_run_test. Test will setup cluster and pass nodes info to nodeos_run_test. E.g.
# nodeos_run_remote_test.py -v --clean-run --dump-error-detail
###############################################################
Print=Utils.Print
def errorExit(msg="", errorCode=1):
Print("ERROR:", msg)
exit(errorCode)
args = TestHelper.parse_args({"--dump-error-details","-v","--leave-running","--only-bios","--clean-run"})
debug=args.v
dontKill=args.leave_running
dumpErrorDetails=args.dump_error_details
onlyBios=args.only_bios
killAll=args.clean_run
Utils.Debug=debug
killEosInstances=not dontKill
topo="mesh"
delay=1
prodCount=1 # producers per producer node
pnodes=1
total_nodes=pnodes
actualTest="tests/nodeos_run_test.py"
示例4: errorExit
# 需要导入模块: from TestHelper import TestHelper [as 别名]
# 或者: from TestHelper.TestHelper import parse_args [as 别名]
#!/usr/bin/env python3
from testUtils import Utils
from Cluster import Cluster
from WalletMgr import WalletMgr
from TestHelper import TestHelper
import random
Print=Utils.Print
def errorExit(msg="", errorCode=1):
Print("ERROR:", msg)
exit(errorCode)
args=TestHelper.parse_args({"-p","-n","-d","-s","--nodes-file","--seed"
,"--dump-error-details","-v","--leave-running","--clean-run"})
pnodes=args.p
topo=args.s
delay=args.d
total_nodes = pnodes if args.n == 0 else args.n
debug=args.v
nodesFile=args.nodes_file
seed=args.seed
dontKill=args.leave_running
dumpErrorDetails=args.dump_error_details
killAll=args.clean_run
killWallet=not dontKill
killEosInstances=not dontKill
if nodesFile is not None:
示例5: cmdError
# 需要导入模块: from TestHelper import TestHelper [as 别名]
# 或者: from TestHelper.TestHelper import parse_args [as 别名]
###############################################################
Print=Utils.Print
errorExit=Utils.errorExit
from core_symbol import CORE_SYMBOL
def cmdError(name, cmdCode=0, exitNow=False):
msg="FAILURE - %s%s" % (name, ("" if cmdCode == 0 else (" returned error code %d" % cmdCode)))
if exitNow:
errorExit(msg, True)
else:
Print(msg)
args = TestHelper.parse_args({"--host","--port","--prod-count","--defproducera_prvt_key","--defproducerb_prvt_key","--mongodb"
,"--dump-error-details","--dont-launch","--keep-logs","-v","--leave-running","--only-bios","--clean-run"
,"--sanity-test"})
server=args.host
port=args.port
debug=args.v
enableMongo=args.mongodb
defproduceraPrvtKey=args.defproducera_prvt_key
defproducerbPrvtKey=args.defproducerb_prvt_key
dumpErrorDetails=args.dump_error_details
keepLogs=args.keep_logs
dontLaunch=args.dont_launch
dontKill=args.leave_running
prodCount=args.prod_count
onlyBios=args.only_bios
killAll=args.clean_run
sanityTest=args.sanity_test