Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1c21f2d0
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看板
未验证
提交
1c21f2d0
编写于
11月 13, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
11月 13, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17992 from taosdata/test/sangshuduo/TD-20292-taosbenchmark-schemaless
test: enable telnet_tcp.py case
上级
973fc99f
4a0a805b
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
49 addition
and
58 deletion
+49
-58
tests/develop-test/5-taos-tools/taosbenchmark/json/sml_telnet_tcp.json
...-test/5-taos-tools/taosbenchmark/json/sml_telnet_tcp.json
+1
-7
tests/develop-test/5-taos-tools/taosbenchmark/telnet_tcp.py
tests/develop-test/5-taos-tools/taosbenchmark/telnet_tcp.py
+31
-35
tests/develop-test/test.py
tests/develop-test/test.py
+1
-1
tests/parallel_test/cases.task
tests/parallel_test/cases.task
+1
-0
tests/pytest/util/taosadapter.py
tests/pytest/util/taosadapter.py
+14
-14
tests/system-test/test.py
tests/system-test/test.py
+1
-1
未找到文件。
tests/develop-test/5-taos-tools/taosbenchmark/json/sml_telnet_tcp.json
浏览文件 @
1c21f2d0
...
...
@@ -17,13 +17,7 @@
"databases"
:
[{
"dbinfo"
:
{
"name"
:
"db"
,
"drop"
:
"yes"
,
"replica"
:
1
,
"precision"
:
"ms"
,
"keep"
:
36500
,
"minRows"
:
100
,
"maxRows"
:
4096
,
"comp"
:
2
"drop"
:
"yes"
},
"super_tables"
:
[{
"name"
:
"stb1"
,
...
...
tests/develop-test/5-taos-tools/taosbenchmark/telnet_tcp.py
浏览文件 @
1c21f2d0
...
...
@@ -16,36 +16,40 @@ from util.log import *
from
util.cases
import
*
from
util.sql
import
*
from
util.dnodes
import
*
from
util.taosadapter
import
*
class
TDTestCase
:
def
caseDescription
(
self
):
'''
"""
[TD-11510] taosBenchmark test cases
'''
return
"""
def
init
(
self
,
conn
,
logSql
,
replicaVar
=
1
):
self
.
replicaVar
=
int
(
replicaVar
)
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getPath
(
self
,
tool
=
"taosBenchmark"
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
if
"community"
in
selfPath
:
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
elif
"src"
in
selfPath
:
projPath
=
selfPath
[:
selfPath
.
find
(
"src"
)]
elif
"/tools/"
in
selfPath
:
projPath
=
selfPath
[:
selfPath
.
find
(
"/tools/"
)]
elif
"/tests/"
in
selfPath
:
projPath
=
selfPath
[:
selfPath
.
find
(
"/tests/"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
tdLog
.
exit
(
"cannot found %s in path: %s, use system's"
%
(
tool
,
selfPath
))
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
(
(
tool
)
in
files
)
:
if
(
tool
)
in
files
:
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
)
:
if
"packaging"
not
in
rootRealPath
:
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
if
(
len
(
paths
)
==
0
)
:
if
len
(
paths
)
==
0
:
tdLog
.
exit
(
"taosBenchmark not found!"
)
return
else
:
...
...
@@ -53,38 +57,30 @@ class TDTestCase:
return
paths
[
0
]
def
run
(
self
):
tAdapter
.
init
(
""
)
adapter_cfg
=
{
"influxdb"
:
{
"enable"
:
True
},
"opentsdb"
:
{
"enable"
:
True
},
"opentsdb_telnet"
:
{
"enable"
:
True
,
"maxTCPConnection"
:
250
,
"tcpKeepAlive"
:
True
,
"dbs"
:
[
"opentsdb_telnet"
,
"collectd"
,
"icinga2"
,
"tcollector"
],
"ports"
:
[
6046
,
6047
,
6048
,
6049
],
"user"
:
"root"
,
"password"
:
"taosdata"
}
}
tAdapter
.
update_cfg
(
adapter_cfg
)
tAdapter
.
deploy
()
tAdapter
.
start
()
binPath
=
self
.
getPath
()
cmd
=
"%s -f ./5-taos-tools/taosbenchmark/json/sml_telnet_tcp.json"
%
binPath
cmd
=
"%s -f ./5-taos-tools/taosbenchmark/json/sml_telnet_tcp.json"
%
binPath
tdLog
.
info
(
"%s"
%
cmd
)
os
.
system
(
"%s"
%
cmd
)
time
.
sleep
(
5
)
tdSql
.
execute
(
"reset query cache"
)
tdSql
.
query
(
"select count(*) from (select distinct(tbname) from opentsdb_telnet.stb1)"
)
tdSql
.
query
(
"select client_version()"
)
client_ver
=
""
.
join
(
tdSql
.
queryResult
[
0
])
major_ver
=
client_ver
.
split
(
"."
)[
0
]
if
major_ver
==
"3"
:
tdSql
.
query
(
"select count(*) from (select distinct(tbname) from opentsdb_telnet.stb1)"
)
else
:
tdSql
.
query
(
"select count(tbname) from opentsdb_telnet.stb1"
)
tdSql
.
checkData
(
0
,
0
,
8
)
tdSql
.
query
(
"select count(*) from opentsdb_telnet.stb1"
)
tdSql
.
checkData
(
0
,
0
,
160
)
tdSql
.
query
(
"select count(*) from (select distinct(tbname) from opentsdb_telnet.stb2)"
)
if
major_ver
==
"3"
:
tdSql
.
query
(
"select count(*) from (select distinct(tbname) from opentsdb_telnet.stb2)"
)
else
:
tdSql
.
query
(
"select count(tbname) from opentsdb_telnet.stb2"
)
tdSql
.
checkData
(
0
,
0
,
8
)
tdSql
.
query
(
"select count(*) from opentsdb_telnet.stb2"
)
tdSql
.
checkData
(
0
,
0
,
160
)
...
...
tests/develop-test/test.py
浏览文件 @
1c21f2d0
...
...
@@ -238,7 +238,7 @@ if __name__ == "__main__":
time
.
sleep
(
2
)
if
restful
:
toBeKilled
=
"taosadapt"
toBeKilled
=
"taosadapt
er
"
# killCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}' | xargs kill -TERM > /dev/null 2>&1" % toBeKilled
killCmd
=
f
"pkill
{
toBeKilled
}
"
...
...
tests/parallel_test/cases.task
浏览文件 @
1c21f2d0
...
...
@@ -1006,6 +1006,7 @@
,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/sample_csv_json.py
,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/sml_json_alltypes.py
,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/taosdemoTestQueryWithJson.py -R
,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/telnet_tcp.py -R
#docs-examples test
,,,docs-examples-test,bash python.sh
...
...
tests/pytest/util/taosadapter.py
浏览文件 @
1c21f2d0
...
...
@@ -13,7 +13,7 @@ class TAdapter:
"debug"
:
True
,
"taosConfigDir"
:
""
,
"port"
:
6041
,
"logLevel"
:
"
debug
"
,
"logLevel"
:
"
error
"
,
"cors"
:
{
"allowAllOrigins"
:
True
,
},
...
...
@@ -49,25 +49,25 @@ class TAdapter:
"writeInterval"
:
"30s"
},
"opentsdb"
:
{
"enable"
:
Fals
e
"enable"
:
Tru
e
},
"influxdb"
:
{
"enable"
:
Fals
e
"enable"
:
Tru
e
},
"statsd"
:
{
"enable"
:
Fals
e
"enable"
:
Tru
e
},
"collectd"
:
{
"enable"
:
Fals
e
"enable"
:
Tru
e
},
"opentsdb_telnet"
:
{
"enable"
:
Fals
e
"enable"
:
Tru
e
},
"node_exporter"
:
{
"enable"
:
Fals
e
"enable"
:
Tru
e
},
"prometheus"
:
{
"enable"
:
Fals
e
"enable"
:
Tru
e
},
}
# TODO: add taosadapter env:
...
...
@@ -164,7 +164,7 @@ class TAdapter:
if
platform
.
system
().
lower
()
==
'windows'
:
cmd
=
f
"mintty -h never
{
bin_path
}
-c
{
self
.
cfg_dir
}
"
else
:
cmd
=
f
"nohup
{
bin_path
}
-c
{
self
.
cfg_path
}
> /dev/null
2>&1
& "
cmd
=
f
"nohup
{
bin_path
}
-c
{
self
.
cfg_path
}
> /dev/null & "
if
self
.
remoteIP
:
self
.
remote_exec
(
self
.
taosadapter_cfg_dict
,
f
"tAdapter.deployed=1
\n
tAdapter.log_dir=
{
self
.
log_dir
}
\n
tAdapter.cfg_dir=
{
self
.
cfg_dir
}
\n
tAdapter.start()"
)
...
...
@@ -213,7 +213,7 @@ class TAdapter:
if
platform
.
system
().
lower
()
==
'windows'
:
cmd
=
f
"mintty -h never
{
bin_path
}
-c
{
self
.
cfg_dir
}
"
else
:
cmd
=
f
"nohup
{
bin_path
}
-c
{
self
.
cfg_path
}
> /dev/null
2>&1
& "
cmd
=
f
"nohup
{
bin_path
}
-c
{
self
.
cfg_path
}
> /dev/null & "
if
self
.
remoteIP
:
self
.
remote_exec
(
self
.
taosadapter_cfg_dict
,
f
"tAdapter.deployed=1
\n
tAdapter.log_dir=
{
self
.
log_dir
}
\n
tAdapter.cfg_dir=
{
self
.
cfg_dir
}
\n
tAdapter.start()"
)
...
...
@@ -243,7 +243,7 @@ class TAdapter:
psCmd
,
shell
=
True
)
while
(
processID
):
killCmd
=
f
"pkill
{
signal
}
{
processID
}
> /dev/null
2>&1
"
killCmd
=
f
"pkill
{
signal
}
{
processID
}
> /dev/null "
os
.
system
(
killCmd
)
time
.
sleep
(
1
)
processID
=
subprocess
.
check_output
(
...
...
tests/system-test/test.py
浏览文件 @
1c21f2d0
...
...
@@ -215,7 +215,7 @@ if __name__ == "__main__":
time
.
sleep
(
2
)
if
restful
:
toBeKilled
=
"taosadapt"
toBeKilled
=
"taosadapt
er
"
# killCmd = "ps -ef|grep -w %s| grep -v grep | awk '{print $2}' | xargs kill -TERM > /dev/null 2>&1" % toBeKilled
killCmd
=
f
"pkill
{
toBeKilled
}
"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录