Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
0c5c9e5d
Y
YTBP
项目概览
YottaChain
/
YTBP
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
YTBP
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0c5c9e5d
编写于
10月 02, 2018
作者:
B
Brian Johnson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added code to allow setting wallet port for some tests. GH #5674
上级
fd6d31a7
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
27 addition
and
17 deletion
+27
-17
tests/TestHelper.py
tests/TestHelper.py
+7
-0
tests/WalletMgr.py
tests/WalletMgr.py
+5
-8
tests/nodeos_forked_chain_test.py
tests/nodeos_forked_chain_test.py
+4
-2
tests/nodeos_run_test.py
tests/nodeos_run_test.py
+4
-3
tests/nodeos_under_min_avail_ram.py
tests/nodeos_under_min_avail_ram.py
+3
-2
tests/nodeos_voting_test.py
tests/nodeos_voting_test.py
+4
-2
未找到文件。
tests/TestHelper.py
浏览文件 @
0c5c9e5d
...
...
@@ -26,6 +26,7 @@ class AppArgs:
class
TestHelper
(
object
):
LOCAL_HOST
=
"localhost"
DEFAULT_PORT
=
8888
DEFAULT_WALLET_PORT
=
9899
@
staticmethod
# pylint: disable=too-many-branches
...
...
@@ -70,6 +71,12 @@ class TestHelper(object):
if
"--port"
in
includeArgs
:
parser
.
add_argument
(
"-p"
,
"--port"
,
type
=
int
,
help
=
"%s host port"
%
Utils
.
EosServerName
,
default
=
TestHelper
.
DEFAULT_PORT
)
if
"--wallet-host"
in
includeArgs
:
parser
.
add_argument
(
"--wallet-host"
,
type
=
str
,
help
=
"%s host"
%
Utils
.
EosWalletName
,
default
=
TestHelper
.
LOCAL_HOST
)
if
"--wallet-port"
in
includeArgs
:
parser
.
add_argument
(
"--wallet-port"
,
type
=
int
,
help
=
"%s port"
%
Utils
.
EosWalletName
,
default
=
TestHelper
.
DEFAULT_WALLET_PORT
)
if
"--prod-count"
in
includeArgs
:
parser
.
add_argument
(
"-c"
,
"--prod-count"
,
type
=
int
,
help
=
"Per node producer count"
,
default
=
1
)
if
"--defproducera_prvt_key"
in
includeArgs
:
...
...
tests/WalletMgr.py
浏览文件 @
0c5c9e5d
...
...
@@ -65,16 +65,12 @@ class WalletMgr(object):
if
self
.
isLocal
():
self
.
port
=
self
.
findAvailablePort
()
pgrepCmd
=
Utils
.
pgrepCmd
(
Utils
.
EosWalletName
)
if
Utils
.
Debug
:
portStatus
=
"N/A"
portTaken
=
False
if
self
.
isLocal
():
if
Utils
.
arePortsAvailable
(
self
.
port
):
portStatus
=
"AVAILABLE"
else
:
portStatus
=
"NOT AVAILABLE"
if
not
Utils
.
arePortsAvailable
(
self
.
port
):
portTaken
=
True
pgrepCmd
=
Utils
.
pgrepCmd
(
Utils
.
EosWalletName
)
psOut
=
Utils
.
checkOutput
(
pgrepCmd
.
split
(),
ignoreError
=
True
)
if
psOut
or
portTaken
:
statusMsg
=
""
...
...
@@ -95,10 +91,11 @@ class WalletMgr(object):
time
.
sleep
(
2
)
try
:
if
Utils
.
Debug
:
Utils
.
Print
(
"Checking if %s launched. %s"
%
(
Utils
.
EosWalletName
,
pgrepCmd
))
psOut
=
Utils
.
checkOutput
(
pgrepCmd
.
split
())
if
Utils
.
Debug
:
Utils
.
Print
(
"Launched %s.
%s - {%s}"
%
(
Utils
.
EosWalletName
,
pgrepCmd
,
psOut
))
if
Utils
.
Debug
:
Utils
.
Print
(
"Launched %s.
{%s}"
%
(
Utils
.
EosWalletName
,
psOut
))
except
subprocess
.
CalledProcessError
as
ex
:
Utils
.
errorExit
(
"Failed to launch the wallet manager
on
"
)
Utils
.
errorExit
(
"Failed to launch the wallet manager"
)
return
True
...
...
tests/nodeos_forked_chain_test.py
浏览文件 @
0c5c9e5d
...
...
@@ -102,7 +102,8 @@ def getMinHeadAndLib(prodNodes):
args
=
TestHelper
.
parse_args
({
"--prod-count"
,
"--dump-error-details"
,
"--keep-logs"
,
"-v"
,
"--leave-running"
,
"--clean-run"
,
"--p2p-plugin"
})
args
=
TestHelper
.
parse_args
({
"--prod-count"
,
"--dump-error-details"
,
"--keep-logs"
,
"-v"
,
"--leave-running"
,
"--clean-run"
,
"--p2p-plugin"
,
"--wallet-port"
})
Utils
.
Debug
=
args
.
v
totalProducerNodes
=
2
totalNonProducerNodes
=
1
...
...
@@ -116,8 +117,9 @@ dontKill=args.leave_running
prodCount
=
args
.
prod_count
killAll
=
args
.
clean_run
p2pPlugin
=
args
.
p2p_plugin
walletPort
=
args
.
wallet_port
walletMgr
=
WalletMgr
(
True
)
walletMgr
=
WalletMgr
(
True
,
port
=
walletPort
)
testSuccessful
=
False
killEosInstances
=
not
dontKill
killWallet
=
not
dontKill
...
...
tests/nodeos_run_test.py
浏览文件 @
0c5c9e5d
...
...
@@ -22,7 +22,7 @@ from core_symbol import CORE_SYMBOL
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"
,
"--p2p-plugin"
})
,
"--sanity-test"
,
"--p2p-plugin"
,
"--wallet-port"
})
server
=
args
.
host
port
=
args
.
port
debug
=
args
.
v
...
...
@@ -38,15 +38,16 @@ onlyBios=args.only_bios
killAll
=
args
.
clean_run
sanityTest
=
args
.
sanity_test
p2pPlugin
=
args
.
p2p_plugin
walletPort
=
args
.
wallet_port
Utils
.
Debug
=
debug
localTest
=
True
if
server
==
TestHelper
.
LOCAL_HOST
else
False
cluster
=
Cluster
(
walletd
=
True
,
enableMongo
=
enableMongo
,
defproduceraPrvtKey
=
defproduceraPrvtKey
,
defproducerbPrvtKey
=
defproducerbPrvtKey
)
walletMgr
=
WalletMgr
(
True
)
walletMgr
=
WalletMgr
(
True
,
port
=
walletPort
)
testSuccessful
=
False
killEosInstances
=
not
dontKill
killWallet
=
not
dontKill
dontBootstrap
=
sanityTest
dontBootstrap
=
sanityTest
# intent is to limit the scope of the sanity test to just verifying that nodes can be started
WalletdName
=
Utils
.
EosWalletName
ClientName
=
"cleos"
...
...
tests/nodeos_under_min_avail_ram.py
浏览文件 @
0c5c9e5d
...
...
@@ -54,7 +54,7 @@ class NamedAccounts:
# --keep-logs <Don't delete var/lib/node_* folders upon test completion>
###############################################################
args
=
TestHelper
.
parse_args
({
"--dump-error-details"
,
"--keep-logs"
,
"-v"
,
"--leave-running"
,
"--clean-run"
})
args
=
TestHelper
.
parse_args
({
"--dump-error-details"
,
"--keep-logs"
,
"-v"
,
"--leave-running"
,
"--clean-run"
,
"--wallet-port"
})
Utils
.
Debug
=
args
.
v
totalNodes
=
4
cluster
=
Cluster
(
walletd
=
True
)
...
...
@@ -62,8 +62,9 @@ dumpErrorDetails=args.dump_error_details
keepLogs
=
args
.
keep_logs
dontKill
=
args
.
leave_running
killAll
=
args
.
clean_run
walletPort
=
args
.
wallet_port
walletMgr
=
WalletMgr
(
True
)
walletMgr
=
WalletMgr
(
True
,
port
=
walletPort
)
testSuccessful
=
False
killEosInstances
=
not
dontKill
killWallet
=
not
dontKill
...
...
tests/nodeos_voting_test.py
浏览文件 @
0c5c9e5d
...
...
@@ -140,7 +140,8 @@ errorExit=Utils.errorExit
from
core_symbol
import
CORE_SYMBOL
args
=
TestHelper
.
parse_args
({
"--prod-count"
,
"--dump-error-details"
,
"--keep-logs"
,
"-v"
,
"--leave-running"
,
"--clean-run"
,
"--p2p-plugin"
})
args
=
TestHelper
.
parse_args
({
"--prod-count"
,
"--dump-error-details"
,
"--keep-logs"
,
"-v"
,
"--leave-running"
,
"--clean-run"
,
"--p2p-plugin"
,
"--wallet-port"
})
Utils
.
Debug
=
args
.
v
totalNodes
=
4
cluster
=
Cluster
(
walletd
=
True
)
...
...
@@ -150,8 +151,9 @@ dontKill=args.leave_running
prodCount
=
args
.
prod_count
killAll
=
args
.
clean_run
p2pPlugin
=
args
.
p2p_plugin
walletPort
=
args
.
wallet_port
walletMgr
=
WalletMgr
(
True
)
walletMgr
=
WalletMgr
(
True
,
port
=
walletPort
)
testSuccessful
=
False
killEosInstances
=
not
dontKill
killWallet
=
not
dontKill
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录