Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a21de0d7
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看板
提交
a21de0d7
编写于
10月 25, 2022
作者:
haoranc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: add data and topic of taosdshell cases
上级
c2765ef3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
149 addition
and
62 deletion
+149
-62
tests/system-test/0-others/taosdShell.py
tests/system-test/0-others/taosdShell.py
+68
-39
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
浏览文件 @
a21de0d7
...
...
@@ -106,12 +106,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,54 +155,56 @@ class TDTestCase:
# keyDict['h'] = self.hostname
# keyDict['c'] = cfgPath
# keyDict['P'] = self.serverPort
tdDnodes
.
stop
(
1
)
startAction
=
" --help"
startAction
=
" -s -c "
+
taosdCfgPath
tdLog
.
printNoPrefix
(
"================================ parameter: %s"
%
startAction
)
self
.
taosdCommandExe
(
startAction
,
taosdCmdRun
)
startAction
=
" -h"
tdLog
.
printNoPrefix
(
"================================ parameter: %s"
%
startAction
)
self
.
taosdCommandExe
(
startAction
,
taosdCmdRun
)
# tdDnodes.stop(1)
startAction
=
" -a jsonFile:./taosdCaseTmp.json"
tdLog
.
printNoPrefix
(
"================================ parameter: %s"
%
startAction
)
os
.
system
(
"echo
\'
{
\"
queryPolicy
\"
:
\"
3
\"
}
\'
> taosdCaseTmp.json"
)
self
.
taosdCommandStop
(
startAction
,
taosdCmdRun
)
# startAction = " --help"
# tdLog.printNoPrefix("================================ parameter: %s"%startAction)
# self.taosdCommandExe(startAction,taosdCmdRun)
startAction
=
" -a jsonFile:./taosdCaseTmp.json -C
"
tdLog
.
printNoPrefix
(
"================================ parameter: %s"
%
startAction
)
self
.
taosdCommandExe
(
startAction
,
taosdCmdRun
)
# startAction = " -h
"
#
tdLog.printNoPrefix("================================ parameter: %s"%startAction)
#
self.taosdCommandExe(startAction,taosdCmdRun)
os
.
system
(
"rm -rf taosdCaseTmp.json"
)
# startAction=" -a jsonFile:./taosdCaseTmp.json"
# tdLog.printNoPrefix("================================ parameter: %s"%startAction)
# os.system("echo \'{\"queryPolicy\":\"3\"}\' > taosdCaseTmp.json")
# self.taosdCommandStop(startAction,taosdCmdRun)
startAction
=
" -c "
+
taosdCfgPath
tdLog
.
printNoPrefix
(
"================================ parameter: %s"
%
startAction
)
self
.
taosdCommandStop
(
startAction
,
taosdCmdRun
)
# startAction = " -a jsonFile:./taosdCaseTmp.json -C "
#
tdLog.printNoPrefix("================================ parameter: %s"%startAction)
# self.taosdCommandExe
(startAction,taosdCmdRun)
startAction
=
" -s"
tdLog
.
printNoPrefix
(
"================================ parameter: %s"
%
startAction
)
self
.
taosdCommandExe
(
startAction
,
taosdCmdRun
)
# os.system("rm -rf taosdCaseTmp.json")
startAction
=
" -e TAOS_QUERY_POLICY=2 "
tdLog
.
printNoPrefix
(
"================================ parameter: %s"
%
startAction
)
self
.
taosdCommandStop
(
startAction
,
taosdCmdRun
)
# startAction = " -c " + taosdCfgPath
#
tdLog.printNoPrefix("================================ parameter: %s"%startAction)
#
self.taosdCommandStop(startAction,taosdCmdRun)
startAction
=
" -E taosdCaseTmp/.env"
tdLog
.
printNoPrefix
(
"================================ parameter: %s"
%
startAction
)
os
.
system
(
" mkdir -p taosdCaseTmp/.env "
)
os
.
system
(
"echo
\'
TAOS_QUERY_POLICY=3
\'
> taosdCaseTmp/.env "
)
self
.
taosdCommandStop
(
startAction
,
taosdCmdRun
)
os
.
system
(
" rm -rf taosdCaseTmp/.env "
)
startAction
=
" -V
"
tdLog
.
printNoPrefix
(
"================================ parameter: %s"
%
startAction
)
self
.
taosdCommandExe
(
startAction
,
taosdCmdRun
)
# startAction = " -e TAOS_QUERY_POLICY=2
"
#
tdLog.printNoPrefix("================================ parameter: %s"%startAction)
# self.taosdCommandStop
(startAction,taosdCmdRun)
startAction
=
" -k"
tdLog
.
printNoPrefix
(
"================================ parameter: %s"
%
startAction
)
self
.
taosdCommandExe
(
startAction
,
taosdCmdRun
)
# startAction=" -E taosdCaseTmp/.env"
# tdLog.printNoPrefix("================================ parameter: %s"%startAction)
# os.system(" mkdir -p taosdCaseTmp/.env ")
# os.system("echo \'TAOS_QUERY_POLICY=3\' > taosdCaseTmp/.env ")
# self.taosdCommandStop(startAction,taosdCmdRun)
# os.system(" rm -rf taosdCaseTmp/.env ")
# startAction = " -V"
# tdLog.printNoPrefix("================================ parameter: %s"%startAction)
# self.taosdCommandExe(startAction,taosdCmdRun)
# startAction = " -k"
# tdLog.printNoPrefix("================================ parameter: %s"%startAction)
# self.taosdCommandExe(startAction,taosdCmdRun)
def
stop
(
self
):
tdSql
.
close
()
...
...
tests/system-test/fulltest.sh
浏览文件 @
a21de0d7
...
...
@@ -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
...
...
@@ -362,7 +362,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
...
...
@@ -401,13 +401,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
...
...
@@ -431,8 +435,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
...
...
@@ -452,7 +457,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
...
...
@@ -463,7 +468,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
...
...
@@ -489,12 +494,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
...
...
@@ -543,7 +554,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
...
...
@@ -554,7 +565,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
...
...
@@ -580,12 +591,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
...
...
@@ -609,5 +627,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
浏览文件 @
a21de0d7
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录