Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
eb87a0d1
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
未验证
提交
eb87a0d1
编写于
10月 25, 2022
作者:
H
Hui Li
提交者:
GitHub
10月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17625 from taosdata/test/TD19597
test: add data and topic of taosdshell cases
上级
a2ceb04c
c09c82ab
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
123 addition
and
31 deletion
+123
-31
tests/system-test/0-others/taosdShell.py
tests/system-test/0-others/taosdShell.py
+42
-8
tests/system-test/fulltest.sh
tests/system-test/fulltest.sh
+40
-22
tests/system-test/test.py
tests/system-test/test.py
+41
-1
未找到文件。
tests/system-test/0-others/taosdShell.py
浏览文件 @
eb87a0d1
...
...
@@ -14,6 +14,7 @@ from util.log import *
from
util.sql
import
*
from
util.cases
import
*
from
util.dnodes
import
*
from
util.cluster
import
*
class
TDTestCase
:
#updatecfgDict = {'clientCfg': {'serverPort': 7080, 'firstEp': 'trd02:7080', 'secondEp':'trd02:7080'},\
...
...
@@ -106,12 +107,39 @@ class TDTestCase:
tdLog
.
printNoPrefix
(
"%s"
%
taosdCmd
)
os
.
system
(
f
"
{
taosdCmd
}
"
)
def
preData
(
self
):
# database\stb\tb\chiild-tb\rows\topics
tdSql
.
execute
(
"create user testpy pass 'testpy'"
)
tdSql
.
execute
(
"drop database if exists db0;"
)
tdSql
.
execute
(
"create database db0;"
)
tdSql
.
execute
(
"use db0;"
)
tdSql
.
execute
(
"create table if not exists db0.stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned);"
)
tdSql
.
execute
(
"create table db0.ct1 using db0.stb tags(1000);"
)
tdSql
.
execute
(
"create table db0.ct2 using db0.stb tags(2000);"
)
tdSql
.
execute
(
"create table if not exists db0.ntb (ts timestamp, c1 int, c2 float, c3 double) ;"
)
tdSql
.
query
(
"show db0.stables;"
)
tdSql
.
execute
(
"insert into db0.ct1 values(now+0s, 10, 2.0, 3.0);"
)
tdSql
.
execute
(
"insert into db0.ct1 values(now+1s, 11, 2.1, 3.1)(now+2s, 12, 2.2, 3.2)(now+3s, 13, 2.3, 3.3);"
)
tdSql
.
execute
(
"insert into db0.ntb values(now+2s, 10, 2.0, 3.0);"
)
tdSql
.
execute
(
"create sma index sma_index_name1 on db0.stb function(max(c1),max(c2),min(c1)) interval(6m,10s) sliding(6m);"
)
tdSql
.
execute
(
"create topic tpc1 as select * from db0.ct2; "
)
#stream
tdSql
.
execute
(
"drop database if exists source_db;"
)
tdSql
.
query
(
"create database source_db vgroups 3;"
)
tdSql
.
query
(
"use source_db"
)
tdSql
.
query
(
"create table if not exists source_db.stb (ts timestamp, k int) tags (a int);"
)
tdSql
.
query
(
"create table source_db.ct1 using source_db.stb tags(1000);create table source_db.ct2 using source_db.stb tags(2000);create table source_db.ct3 using source_db.stb tags(3000);"
)
tdSql
.
query
(
"create stream s1 into source_db.output_stb as select _wstart AS start, min(k), max(k), sum(k) from source_db.stb interval(10m);"
)
def
run
(
self
):
tdSql
.
prepare
()
#
tdSql.prepare()
# time.sleep(2)
tdSql
.
query
(
"create user testpy pass 'testpy'"
)
#hostname = socket.gethostname()
self
.
preData
()
#tdLog.info ("hostname: %s" % hostname)
buildPath
=
self
.
getBuildPath
()
...
...
@@ -128,7 +156,15 @@ class TDTestCase:
# keyDict['h'] = self.hostname
# keyDict['c'] = cfgPath
# keyDict['P'] = self.serverPort
tdDnodes
.
stop
(
1
)
tdDnodes
=
cluster
.
dnodes
for
i
in
range
(
5
):
tdDnodes
[
i
].
stoptaosd
()
startAction
=
" -s -c "
+
taosdCfgPath
tdLog
.
printNoPrefix
(
"================================ parameter: %s"
%
startAction
)
self
.
taosdCommandExe
(
startAction
,
taosdCmdRun
)
startAction
=
" --help"
tdLog
.
printNoPrefix
(
"================================ parameter: %s"
%
startAction
)
...
...
@@ -153,9 +189,7 @@ class TDTestCase:
tdLog
.
printNoPrefix
(
"================================ parameter: %s"
%
startAction
)
self
.
taosdCommandStop
(
startAction
,
taosdCmdRun
)
startAction
=
" -s"
tdLog
.
printNoPrefix
(
"================================ parameter: %s"
%
startAction
)
self
.
taosdCommandExe
(
startAction
,
taosdCmdRun
)
startAction
=
" -e TAOS_QUERY_POLICY=2 "
tdLog
.
printNoPrefix
(
"================================ parameter: %s"
%
startAction
)
...
...
tests/system-test/fulltest.sh
浏览文件 @
eb87a0d1
...
...
@@ -13,7 +13,7 @@ python3 ./test.py -f 0-others/udf_restart_taosd.py
python3 ./test.py
-f
0-others/cachemodel.py
python3 ./test.py
-f
0-others/udf_cfg1.py
python3 ./test.py
-f
0-others/udf_cfg2.py
python3 ./test.py
-f
0-others/taosdShell.py
-N
5
-M
3
-Q
3
python3 ./test.py
-f
0-others/sysinfo.py
python3 ./test.py
-f
0-others/user_control.py
python3 ./test.py
-f
0-others/fsync.py
...
...
@@ -363,7 +363,7 @@ python3 ./test.py -f 2-query/concat.py -Q 2
python3 ./test.py
-f
2-query/concat2.py
-Q
2
python3 ./test.py
-f
2-query/concat_ws.py
-Q
2
python3 ./test.py
-f
2-query/concat_ws2.py
-Q
2
#
python3 ./test.py -f 2-query/check_tsdb.py -Q 2
python3 ./test.py
-f
2-query/check_tsdb.py
-Q
2
python3 ./test.py
-f
2-query/spread.py
-Q
2
python3 ./test.py
-f
2-query/hyperloglog.py
-Q
2
python3 ./test.py
-f
2-query/explain.py
-Q
2
...
...
@@ -402,13 +402,17 @@ python3 ./test.py -f 2-query/arctan.py -Q 2
python3 ./test.py
-f
2-query/query_cols_tags_and_or.py
-Q
2
python3 ./test.py
-f
2-query/interp.py
-Q
2
# python3 ./test.py -f 2-query/nestedQuery.py -Q 2
# python3 ./test.py -f 2-query/nestedQuery_str.py -Q 2
python3 ./test.py
-f
2-query/nestedQuery.py
-Q
2
python3 ./test.py
-f
2-query/nestedQuery_str.py
-Q
2
python3 ./test.py
-f
2-query/nestedQuery_math.py
-Q
2
python3 ./test.py
-f
2-query/nestedQuery_time.py
-Q
2
python3 ./test.py
-f
2-query/stablity.py
-Q
2
python3 ./test.py
-f
2-query/stablity_1.py
-Q
2
python3 ./test.py
-f
2-query/avg.py
-Q
2
#
python3 ./test.py -f 2-query/elapsed.py -Q 2
python3 ./test.py
-f
2-query/elapsed.py
-Q
2
python3 ./test.py
-f
2-query/csum.py
-Q
2
#
python3 ./test.py -f 2-query/mavg.py -Q 2
python3 ./test.py
-f
2-query/mavg.py
-Q
2
python3 ./test.py
-f
2-query/sample.py
-Q
2
python3 ./test.py
-f
2-query/function_diff.py
-Q
2
python3 ./test.py
-f
2-query/unique.py
-Q
2
...
...
@@ -432,8 +436,9 @@ python3 ./test.py -f 2-query/count_partition.py -Q 2
python3 ./test.py
-f
2-query/max_partition.py
-Q
2
python3 ./test.py
-f
2-query/last_row.py
-Q
2
python3 ./test.py
-f
2-query/tsbsQuery.py
-Q
2
#------------querPolicy 3-----------
python3 ./test.py
-f
2-query/sml.py
-Q
2
#------------querPolicy 3-----------
python3 ./test.py
-f
2-query/between.py
-Q
3
python3 ./test.py
-f
2-query/distinct.py
-Q
3
python3 ./test.py
-f
2-query/varchar.py
-Q
3
...
...
@@ -453,7 +458,7 @@ python3 ./test.py -f 2-query/concat.py -Q 3
python3 ./test.py
-f
2-query/concat2.py
-Q
3
python3 ./test.py
-f
2-query/concat_ws.py
-Q
3
python3 ./test.py
-f
2-query/concat_ws2.py
-Q
3
#
python3 ./test.py -f 2-query/check_tsdb.py -Q 3
python3 ./test.py
-f
2-query/check_tsdb.py
-Q
3
python3 ./test.py
-f
2-query/spread.py
-Q
3
python3 ./test.py
-f
2-query/hyperloglog.py
-Q
3
python3 ./test.py
-f
2-query/explain.py
-Q
3
...
...
@@ -464,7 +469,7 @@ python3 ./test.py -f 2-query/Today.py -Q 3
python3 ./test.py
-f
2-query/max.py
-Q
3
python3 ./test.py
-f
2-query/min.py
-Q
3
python3 ./test.py
-f
2-query/count.py
-Q
3
#
python3 ./test.py -f 2-query/last.py -Q 3
python3 ./test.py
-f
2-query/last.py
-Q
3
python3 ./test.py
-f
2-query/first.py
-Q
3
python3 ./test.py
-f
2-query/To_iso8601.py
-Q
3
python3 ./test.py
-f
2-query/To_unixtimestamp.py
-Q
3
...
...
@@ -490,12 +495,18 @@ python3 ./test.py -f 2-query/arcsin.py -Q 3
python3 ./test.py
-f
2-query/arccos.py
-Q
3
python3 ./test.py
-f
2-query/arctan.py
-Q
3
python3 ./test.py
-f
2-query/query_cols_tags_and_or.py
-Q
3
# python3 ./test.py -f 2-query/nestedQuery.py -Q 3
# python3 ./test.py -f 2-query/nestedQuery_str.py -Q 3
# python3 ./test.py -f 2-query/avg.py -Q 3
# python3 ./test.py -f 2-query/elapsed.py -Q 3
python3 ./test.py
-f
2-query/nestedQuery.py
-Q
3
python3 ./test.py
-f
2-query/nestedQuery_str.py
-Q
3
python3 ./test.py
-f
2-query/nestedQuery_math.py
-Q
3
python3 ./test.py
-f
2-query/nestedQuery_time.py
-Q
3
python3 ./test.py
-f
2-query/stablity.py
-Q
3
python3 ./test.py
-f
2-query/stablity_1.py
-Q
3
python3 ./test.py
-f
2-query/avg.py
-Q
3
python3 ./test.py
-f
2-query/elapsed.py
-Q
3
python3 ./test.py
-f
2-query/csum.py
-Q
3
#
python3 ./test.py -f 2-query/mavg.py -Q 3
python3 ./test.py
-f
2-query/mavg.py
-Q
3
python3 ./test.py
-f
2-query/sample.py
-Q
3
python3 ./test.py
-f
2-query/function_diff.py
-Q
3
python3 ./test.py
-f
2-query/unique.py
-Q
3
...
...
@@ -544,7 +555,7 @@ python3 ./test.py -f 2-query/concat.py -Q 4
python3 ./test.py
-f
2-query/concat2.py
-Q
4
python3 ./test.py
-f
2-query/concat_ws.py
-Q
4
python3 ./test.py
-f
2-query/concat_ws2.py
-Q
4
#
python3 ./test.py -f 2-query/check_tsdb.py -Q 4
python3 ./test.py
-f
2-query/check_tsdb.py
-Q
4
python3 ./test.py
-f
2-query/spread.py
-Q
4
python3 ./test.py
-f
2-query/hyperloglog.py
-Q
4
python3 ./test.py
-f
2-query/explain.py
-Q
4
...
...
@@ -555,7 +566,7 @@ python3 ./test.py -f 2-query/Today.py -Q 4
python3 ./test.py
-f
2-query/max.py
-Q
4
python3 ./test.py
-f
2-query/min.py
-Q
4
python3 ./test.py
-f
2-query/count.py
-Q
4
#
python3 ./test.py -f 2-query/last.py -Q 4
python3 ./test.py
-f
2-query/last.py
-Q
4
python3 ./test.py
-f
2-query/first.py
-Q
4
python3 ./test.py
-f
2-query/To_iso8601.py
-Q
4
python3 ./test.py
-f
2-query/To_unixtimestamp.py
-Q
4
...
...
@@ -581,12 +592,19 @@ python3 ./test.py -f 2-query/arcsin.py -Q 4
python3 ./test.py
-f
2-query/arccos.py
-Q
4
python3 ./test.py
-f
2-query/arctan.py
-Q
4
python3 ./test.py
-f
2-query/query_cols_tags_and_or.py
-Q
4
# python3 ./test.py -f 2-query/nestedQuery.py -Q 4
# python3 ./test.py -f 2-query/nestedQuery_str.py -Q 4
# python3 ./test.py -f 2-query/avg.py -Q 4
# python3 ./test.py -f 2-query/elapsed.py -Q 4
#python3 ./test.py -f 2-query/nestedQuery.py -Q 4
python3 ./test.py
-f
2-query/nestedQuery_str.py
-Q
4
python3 ./test.py
-f
2-query/nestedQuery_math.py
-Q
4
python3 ./test.py
-f
2-query/nestedQuery_time.py
-Q
4
python3 ./test.py
-f
2-query/stablity.py
-Q
4
python3 ./test.py
-f
2-query/stablity_1.py
-Q
4
python3 ./test.py
-f
2-query/avg.py
-Q
4
python3 ./test.py
-f
2-query/elapsed.py
-Q
4
python3 ./test.py
-f
2-query/csum.py
-Q
4
#
python3 ./test.py -f 2-query/mavg.py -Q 4
python3 ./test.py
-f
2-query/mavg.py
-Q
4
python3 ./test.py
-f
2-query/sample.py
-Q
4
python3 ./test.py
-f
2-query/function_diff.py
-Q
4
python3 ./test.py
-f
2-query/unique.py
-Q
4
...
...
@@ -610,5 +628,5 @@ python3 ./test.py -f 2-query/count_partition.py -Q 4
python3 ./test.py
-f
2-query/max_partition.py
-Q
4
python3 ./test.py
-f
2-query/last_row.py
-Q
4
python3 ./test.py
-f
2-query/tsbsQuery.py
-Q
4
#
python3 ./test.py -f 2-query/sml.py -Q 4
python3 ./test.py
-f
2-query/sml.py
-Q
4
python3 ./test.py
-f
2-query/interp.py
-Q
4
tests/system-test/test.py
浏览文件 @
eb87a0d1
...
...
@@ -321,7 +321,7 @@ if __name__ == "__main__":
for
dnode
in
tdDnodes
.
dnodes
:
tdDnodes
.
starttaosd
(
dnode
.
index
)
tdCases
.
logSql
(
logSql
)
if
restful
:
tAdapter
.
deploy
(
adapter_cfg_dict
)
tAdapter
.
start
()
...
...
@@ -341,6 +341,26 @@ if __name__ == "__main__":
print
(
"check dnode ready"
)
except
Exception
as
r
:
print
(
r
)
if
queryPolicy
!=
1
:
queryPolicy
=
int
(
queryPolicy
)
if
restful
:
conn
=
taosrest
.
connect
(
url
=
f
"http://
{
host
}
:6041"
)
else
:
conn
=
taos
.
connect
(
host
,
config
=
tdDnodes
.
getSimCfgPath
())
cursor
=
conn
.
cursor
()
cursor
.
execute
(
"create qnode on dnode 1"
)
cursor
.
execute
(
f
'alter local "queryPolicy" "
{
queryPolicy
}
"'
)
cursor
.
execute
(
"show local variables"
)
res
=
cursor
.
fetchall
()
for
i
in
range
(
cursor
.
rowcount
):
if
res
[
i
][
0
]
==
"queryPolicy"
:
if
int
(
res
[
i
][
1
])
==
int
(
queryPolicy
):
tdLog
.
success
(
f
'alter queryPolicy to
{
queryPolicy
}
successfully'
)
else
:
tdLog
.
debug
(
res
)
tdLog
.
exit
(
f
"alter queryPolicy to
{
queryPolicy
}
failed"
)
if
ucase
is
not
None
and
hasattr
(
ucase
,
'noConn'
)
and
ucase
.
noConn
==
True
:
conn
=
None
else
:
...
...
@@ -455,6 +475,26 @@ if __name__ == "__main__":
except
Exception
as
r
:
print
(
r
)
if
queryPolicy
!=
1
:
queryPolicy
=
int
(
queryPolicy
)
if
restful
:
conn
=
taosrest
.
connect
(
url
=
f
"http://
{
host
}
:6041"
)
else
:
conn
=
taos
.
connect
(
host
,
config
=
tdDnodes
.
getSimCfgPath
())
cursor
=
conn
.
cursor
()
cursor
.
execute
(
"create qnode on dnode 1"
)
cursor
.
execute
(
f
'alter local "queryPolicy" "
{
queryPolicy
}
"'
)
cursor
.
execute
(
"show local variables"
)
res
=
cursor
.
fetchall
()
for
i
in
range
(
cursor
.
rowcount
):
if
res
[
i
][
0
]
==
"queryPolicy"
:
if
int
(
res
[
i
][
1
])
==
int
(
queryPolicy
):
tdLog
.
success
(
f
'alter queryPolicy to
{
queryPolicy
}
successfully'
)
else
:
tdLog
.
debug
(
res
)
tdLog
.
exit
(
f
"alter queryPolicy to
{
queryPolicy
}
failed"
)
if
testCluster
:
tdLog
.
info
(
"Procedures for testing cluster"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录