Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f8d29a12
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看板
提交
f8d29a12
编写于
5月 31, 2022
作者:
P
plum-lihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: support taosc run by valgrind to python cases
上级
2bc9d1d7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
30 addition
and
18 deletion
+30
-18
tests/pytest/util/dnodes.py
tests/pytest/util/dnodes.py
+22
-16
tests/system-test/test.py
tests/system-test/test.py
+8
-2
未找到文件。
tests/pytest/util/dnodes.py
浏览文件 @
f8d29a12
...
...
@@ -494,6 +494,7 @@ class TDDnodes:
self
.
simDeployed
=
False
self
.
testCluster
=
False
self
.
valgrind
=
0
self
.
killValgrind
=
1
def
init
(
self
,
path
,
remoteIP
=
""
):
psCmd
=
"ps -ef|grep -w taosd| grep -v grep| grep -v defunct | awk '{print $2}'"
...
...
@@ -505,14 +506,15 @@ class TDDnodes:
processID
=
subprocess
.
check_output
(
psCmd
,
shell
=
True
).
decode
(
"utf-8"
)
psCmd
=
"ps -ef|grep -w valgrind.bin| grep -v grep | awk '{print $2}'"
processID
=
subprocess
.
check_output
(
psCmd
,
shell
=
True
).
decode
(
"utf-8"
)
while
(
processID
):
killCmd
=
"kill -9 %s > /dev/null 2>&1"
%
processID
os
.
system
(
killCmd
)
time
.
sleep
(
1
)
processID
=
subprocess
.
check_output
(
psCmd
,
shell
=
True
).
decode
(
"utf-8"
)
if
self
.
killValgrind
==
1
:
psCmd
=
"ps -ef|grep -w valgrind.bin| grep -v grep | awk '{print $2}'"
processID
=
subprocess
.
check_output
(
psCmd
,
shell
=
True
).
decode
(
"utf-8"
)
while
(
processID
):
killCmd
=
"kill -9 %s > /dev/null 2>&1"
%
processID
os
.
system
(
killCmd
)
time
.
sleep
(
1
)
processID
=
subprocess
.
check_output
(
psCmd
,
shell
=
True
).
decode
(
"utf-8"
)
binPath
=
self
.
dnodes
[
0
].
getPath
()
+
"/../../../"
# tdLog.debug("binPath %s" % (binPath))
...
...
@@ -549,6 +551,9 @@ class TDDnodes:
def
setValgrind
(
self
,
value
):
self
.
valgrind
=
value
def
setKillValgrind
(
self
,
value
):
self
.
killValgrind
=
value
def
deploy
(
self
,
index
,
*
updatecfgDict
):
self
.
sim
.
setTestCluster
(
self
.
testCluster
)
...
...
@@ -622,14 +627,15 @@ class TDDnodes:
processID
=
subprocess
.
check_output
(
psCmd
,
shell
=
True
).
decode
(
"utf-8"
)
psCmd
=
"ps -ef|grep -w valgrind.bin| grep -v grep | awk '{print $2}'"
processID
=
subprocess
.
check_output
(
psCmd
,
shell
=
True
).
decode
(
"utf-8"
)
while
(
processID
):
killCmd
=
"kill -TERM %s > /dev/null 2>&1"
%
processID
os
.
system
(
killCmd
)
time
.
sleep
(
1
)
processID
=
subprocess
.
check_output
(
psCmd
,
shell
=
True
).
decode
(
"utf-8"
)
if
self
.
killValgrind
==
1
:
psCmd
=
"ps -ef|grep -w valgrind.bin| grep -v grep | awk '{print $2}'"
processID
=
subprocess
.
check_output
(
psCmd
,
shell
=
True
).
decode
(
"utf-8"
)
while
(
processID
):
killCmd
=
"kill -TERM %s > /dev/null 2>&1"
%
processID
os
.
system
(
killCmd
)
time
.
sleep
(
1
)
processID
=
subprocess
.
check_output
(
psCmd
,
shell
=
True
).
decode
(
"utf-8"
)
# if os.system(cmd) != 0 :
# tdLog.exit(cmd)
...
...
tests/system-test/test.py
浏览文件 @
f8d29a12
...
...
@@ -37,6 +37,7 @@ if __name__ == "__main__":
masterIp
=
""
testCluster
=
False
valgrind
=
0
killValgrind
=
1
logSql
=
True
stop
=
0
restart
=
False
...
...
@@ -45,8 +46,8 @@ if __name__ == "__main__":
windows
=
1
updateCfgDict
=
{}
execCmd
=
""
opts
,
args
=
getopt
.
gnu_getopt
(
sys
.
argv
[
1
:],
'f:p:m:l:scghrd:e:'
,
[
'file='
,
'path='
,
'master'
,
'logSql'
,
'stop'
,
'cluster'
,
'valgrind'
,
'help'
,
'restart'
,
'updateCfgDict'
,
'execCmd'
])
opts
,
args
=
getopt
.
gnu_getopt
(
sys
.
argv
[
1
:],
'f:p:m:l:scghrd:
k:
e:'
,
[
'file='
,
'path='
,
'master'
,
'logSql'
,
'stop'
,
'cluster'
,
'valgrind'
,
'help'
,
'restart'
,
'updateCfgDict'
,
'
killv'
,
'
execCmd'
])
for
key
,
value
in
opts
:
if
key
in
[
'-h'
,
'--help'
]:
tdLog
.
printNoPrefix
(
...
...
@@ -60,6 +61,7 @@ if __name__ == "__main__":
tdLog
.
printNoPrefix
(
'-g valgrind Test Flag'
)
tdLog
.
printNoPrefix
(
'-r taosd restart test'
)
tdLog
.
printNoPrefix
(
'-d update cfg dict, base64 json str'
)
tdLog
.
printNoPrefix
(
'-k not kill valgrind processer'
)
tdLog
.
printNoPrefix
(
'-e eval str to run'
)
sys
.
exit
(
0
)
...
...
@@ -100,6 +102,9 @@ if __name__ == "__main__":
print
(
'updateCfgDict convert fail.'
)
sys
.
exit
(
0
)
if
key
in
[
'-k'
,
'--killValgrind'
]:
killValgrind
=
0
if
key
in
[
'-e'
,
'--execCmd'
]:
try
:
execCmd
=
base64
.
b64decode
(
value
.
encode
()).
decode
()
...
...
@@ -189,6 +194,7 @@ if __name__ == "__main__":
else
:
tdCases
.
runAllWindows
(
conn
)
else
:
tdDnodes
.
setKillValgrind
(
killValgrind
)
tdDnodes
.
init
(
deployPath
,
masterIp
)
tdDnodes
.
setTestCluster
(
testCluster
)
tdDnodes
.
setValgrind
(
valgrind
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录