Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4d9887cd
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4d9887cd
编写于
12月 17, 2020
作者:
L
liuyq-617
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-2476]<test>enhance test framework
上级
0b2bb3c3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
69 addition
and
36 deletion
+69
-36
tests/pytest/test.py
tests/pytest/test.py
+15
-3
tests/pytest/util/dnodes.py
tests/pytest/util/dnodes.py
+54
-33
未找到文件。
tests/pytest/test.py
浏览文件 @
4d9887cd
...
...
@@ -111,13 +111,25 @@ if __name__ == "__main__":
tdLog
.
info
(
'stop All dnodes'
)
sys
.
exit
(
0
)
tdDnodes
.
init
(
deployPath
)
tdDnodes
.
setTestCluster
(
testCluster
)
tdDnodes
.
setValgrind
(
valgrind
)
tdDnodes
.
stopAll
()
tdDnodes
.
deploy
(
1
)
is_test_framework
=
0
key_word
=
'tdCases.addLinux'
if
key_word
in
open
(
fileName
).
read
():
is_test_framework
=
1
if
is_test_framework
:
moduleName
=
fileName
.
replace
(
".py"
,
""
).
replace
(
"/"
,
"."
)
uModule
=
importlib
.
import_module
(
moduleName
)
try
:
ucase
=
uModule
.
TDTestCase
()
tdDnodes
.
deploy
(
1
,
ucase
.
updatecfgDict
)
except
:
tdDnodes
.
deploy
(
1
,{})
else
:
tdDnodes
.
deploy
(
1
,{})
tdDnodes
.
start
(
1
)
if
masterIp
==
""
:
...
...
tests/pytest/util/dnodes.py
浏览文件 @
4d9887cd
...
...
@@ -108,6 +108,36 @@ class TDDnode:
self
.
deployed
=
0
self
.
testCluster
=
False
self
.
valgrind
=
0
self
.
cfgDict
=
{
"numOfLogLines"
:
"100000000"
,
"mnodeEqualVnodeNum"
:
"0"
,
"walLevel"
:
"2"
,
"fsync"
:
"1000"
,
"statusInterval"
:
"1"
,
"numOfMnodes"
:
"3"
,
"numOfThreadsPerCore"
:
"2.0"
,
"monitor"
:
"0"
,
"maxVnodeConnections"
:
"30000"
,
"maxMgmtConnections"
:
"30000"
,
"maxMeterConnections"
:
"30000"
,
"maxShellConns"
:
"30000"
,
"locale"
:
"en_US.UTF-8"
,
"charset"
:
"UTF-8"
,
"asyncLog"
:
"0"
,
"anyIp"
:
"0"
,
"tsEnableTelemetryReporting"
:
"0"
,
"dDebugFlag"
:
"135"
,
"mDebugFlag"
:
"135"
,
"sdbDebugFlag"
:
"135"
,
"rpcDebugFlag"
:
"135"
,
"tmrDebugFlag"
:
"131"
,
"cDebugFlag"
:
"135"
,
"httpDebugFlag"
:
"135"
,
"monitorDebugFlag"
:
"135"
,
"udebugFlag"
:
"135"
,
"jnidebugFlag"
:
"135"
,
"qdebugFlag"
:
"135"
}
def
init
(
self
,
path
):
self
.
path
=
path
...
...
@@ -131,7 +161,10 @@ class TDDnode:
return
totalSize
def
deploy
(
self
):
def
addExtraCfg
(
self
,
option
,
value
):
self
.
cfgDict
.
update
({
option
:
value
})
def
deploy
(
self
,
*
updatecfgDict
):
self
.
logDir
=
"%s/sim/dnode%d/log"
%
(
self
.
path
,
self
.
index
)
self
.
dataDir
=
"%s/sim/dnode%d/data"
%
(
self
.
path
,
self
.
index
)
self
.
cfgDir
=
"%s/sim/dnode%d/cfg"
%
(
self
.
path
,
self
.
index
)
...
...
@@ -175,36 +208,17 @@ class TDDnode:
self
.
cfg
(
"publicIp"
,
"192.168.0.%d"
%
(
self
.
index
))
self
.
cfg
(
"internalIp"
,
"192.168.0.%d"
%
(
self
.
index
))
self
.
cfg
(
"privateIp"
,
"192.168.0.%d"
%
(
self
.
index
))
self
.
cfg
(
"dataDir"
,
self
.
dataDir
)
self
.
cfg
(
"logDir"
,
self
.
logDir
)
self
.
cfg
(
"numOfLogLines"
,
"100000000"
)
self
.
cfg
(
"mnodeEqualVnodeNum"
,
"0"
)
self
.
cfg
(
"walLevel"
,
"2"
)
self
.
cfg
(
"fsync"
,
"1000"
)
self
.
cfg
(
"statusInterval"
,
"1"
)
self
.
cfg
(
"numOfMnodes"
,
"3"
)
self
.
cfg
(
"numOfThreadsPerCore"
,
"2.0"
)
self
.
cfg
(
"monitor"
,
"0"
)
self
.
cfg
(
"maxVnodeConnections"
,
"30000"
)
self
.
cfg
(
"maxMgmtConnections"
,
"30000"
)
self
.
cfg
(
"maxMeterConnections"
,
"30000"
)
self
.
cfg
(
"maxShellConns"
,
"30000"
)
self
.
cfg
(
"locale"
,
"en_US.UTF-8"
)
self
.
cfg
(
"charset"
,
"UTF-8"
)
self
.
cfg
(
"asyncLog"
,
"0"
)
self
.
cfg
(
"anyIp"
,
"0"
)
self
.
cfg
(
"tsEnableTelemetryReporting"
,
"0"
)
self
.
cfg
(
"dDebugFlag"
,
"135"
)
self
.
cfg
(
"mDebugFlag"
,
"135"
)
self
.
cfg
(
"sdbDebugFlag"
,
"135"
)
self
.
cfg
(
"rpcDebugFlag"
,
"135"
)
self
.
cfg
(
"tmrDebugFlag"
,
"131"
)
self
.
cfg
(
"cDebugFlag"
,
"135"
)
self
.
cfg
(
"httpDebugFlag"
,
"135"
)
self
.
cfg
(
"monitorDebugFlag"
,
"135"
)
self
.
cfg
(
"udebugFlag"
,
"135"
)
self
.
cfg
(
"jnidebugFlag"
,
"135"
)
self
.
cfg
(
"qdebugFlag"
,
"135"
)
self
.
cfg
(
"dataDir"
,
self
.
dataDir
)
self
.
cfg
(
"logDir"
,
self
.
logDir
)
print
(
updatecfgDict
)
if
updatecfgDict
[
0
]
and
updatecfgDict
[
0
][
0
]:
print
(
updatecfgDict
[
0
][
0
])
for
key
,
value
in
updatecfgDict
[
0
][
0
].
items
():
self
.
addExtraCfg
(
key
,
value
)
for
key
,
value
in
self
.
cfgDict
.
items
():
self
.
cfg
(
key
,
value
)
self
.
deployed
=
1
tdLog
.
debug
(
"dnode:%d is deployed and configured by %s"
%
...
...
@@ -260,6 +274,12 @@ class TDDnode:
key
=
'from offline to online'
bkey
=
bytes
(
key
,
encoding
=
"utf8"
)
logFile
=
self
.
logDir
+
"/taosdlog.0"
i
=
0
while
not
os
.
path
.
exists
(
logFile
):
sleep
(
0.1
)
i
+=
1
if
i
>
50
:
break
popen
=
subprocess
.
Popen
(
'tail -f '
+
logFile
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
shell
=
True
)
pid
=
popen
.
pid
print
(
'Popen.pid:'
+
str
(
pid
))
...
...
@@ -273,6 +293,7 @@ class TDDnode:
else
:
tdLog
.
debug
(
"wait 5 seconds for the dnode:%d to start."
%
(
self
.
index
))
time
.
sleep
(
5
)
# time.sleep(5)
...
...
@@ -454,7 +475,7 @@ class TDDnodes:
def
setValgrind
(
self
,
value
):
self
.
valgrind
=
value
def
deploy
(
self
,
index
):
def
deploy
(
self
,
index
,
*
updatecfgDict
):
self
.
sim
.
setTestCluster
(
self
.
testCluster
)
if
(
self
.
simDeployed
==
False
):
...
...
@@ -464,7 +485,7 @@ class TDDnodes:
self
.
check
(
index
)
self
.
dnodes
[
index
-
1
].
setTestCluster
(
self
.
testCluster
)
self
.
dnodes
[
index
-
1
].
setValgrind
(
self
.
valgrind
)
self
.
dnodes
[
index
-
1
].
deploy
()
self
.
dnodes
[
index
-
1
].
deploy
(
updatecfgDict
)
def
cfg
(
self
,
index
,
option
,
value
):
self
.
check
(
index
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录