Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
197bce2c
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
197bce2c
编写于
10月 21, 2021
作者:
H
Hui Li
提交者:
GitHub
10月 21, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #8347 from taosdata/test/TD-10539-d
Test/td 10539 d
上级
1f944f19
56e86981
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
312 addition
and
0 deletion
+312
-0
tests/pytest/fulltest.sh
tests/pytest/fulltest.sh
+1
-0
tests/pytest/tools/taosdemoAllTest/TD-10539/create_taosdemo.py
.../pytest/tools/taosdemoAllTest/TD-10539/create_taosdemo.py
+185
-0
tests/pytest/tools/taosdemoAllTest/TD-10539/create_taosdemo_no.json
...st/tools/taosdemoAllTest/TD-10539/create_taosdemo_no.json
+63
-0
tests/pytest/tools/taosdemoAllTest/TD-10539/create_taosdemo_yes.json
...t/tools/taosdemoAllTest/TD-10539/create_taosdemo_yes.json
+63
-0
未找到文件。
tests/pytest/fulltest.sh
浏览文件 @
197bce2c
...
...
@@ -391,6 +391,7 @@ python3 ./test.py -f tag_lite/alter_tag.py
python3 test.py
-f
tools/taosdemoAllTest/TD-4985/query-limit-offset.py
python3 test.py
-f
tools/taosdemoAllTest/TD-5213/insert4096columns_not_use_taosdemo.py
python3 test.py
-f
tools/taosdemoAllTest/TD-5213/insertSigcolumnsNum4096.py
python3 test.py
-f
tools/taosdemoAllTest/TD-10539/create_taosdemo.py
python3 ./test.py
-f
tag_lite/drop_auto_create.py
python3 test.py
-f
insert/insert_before_use_db.py
python3 test.py
-f
alter/alter_keep.py
...
...
tests/pytest/tools/taosdemoAllTest/TD-10539/create_taosdemo.py
0 → 100644
浏览文件 @
197bce2c
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import
sys
import
taos
import
time
import
os
from
util.log
import
tdLog
from
util.cases
import
tdCases
from
util.sql
import
tdSql
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
getBuildPath
(
self
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
(
"taosd"
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
buildPath
=
root
[:
len
(
root
)
-
len
(
"/build/bin"
)]
break
return
buildPath
def
run
(
self
):
buildPath
=
self
.
getBuildPath
()
if
(
buildPath
==
""
):
tdLog
.
exit
(
"taosd not found!"
)
else
:
tdLog
.
info
(
"taosd found in %s"
%
buildPath
)
binPath
=
buildPath
+
"/build/bin/"
os
.
system
(
"rm -rf tools/taosdemoAllTest/TD-10539/create_taosdemo.py.sql"
)
tdSql
.
prepare
()
#print("==============taosdemo,#create stable,table; insert table; show table; select table; drop table")
self
.
tsdemo
=
"tsdemo~!.@#$%^*[]-_=+{,?.}"
#this escape character is not support in shell . include & () <> | /
os
.
system
(
"%staosdemo -d test -E -m %s -t 10 -n 100 -l 10 -y "
%
(
binPath
,
self
.
tsdemo
))
tdSql
.
execute
(
"use test ;"
)
tdSql
.
query
(
"select count(*) from meters"
)
tdSql
.
checkData
(
0
,
0
,
1000
)
tdSql
.
query
(
"show test.tables like 'tsdemo%'"
)
tdSql
.
checkRows
(
10
)
tdSql
.
query
(
"show test.tables like '%s_'"
%
self
.
tsdemo
)
tdSql
.
checkRows
(
10
)
tdSql
.
query
(
"select _block_dist() from `%s1`"
%
self
.
tsdemo
)
tdSql
.
checkRows
(
1
)
tdSql
.
query
(
"describe test.`%s1` ; "
%
self
.
tsdemo
)
tdSql
.
checkRows
(
13
)
tdSql
.
query
(
"show create table test.`%s1` ; "
%
self
.
tsdemo
)
tdSql
.
checkData
(
0
,
0
,
self
.
tsdemo
+
str
(
1
))
tdSql
.
checkData
(
0
,
1
,
"CREATE TABLE `%s1` USING `meters` TAGS (1,
\"
beijing
\"
)"
%
self
.
tsdemo
)
print
(
"==============drop table\stable"
)
try
:
tdSql
.
execute
(
"drop table test.`%s1` ; "
%
self
.
tsdemo
)
except
Exception
as
e
:
tdLog
.
exit
(
e
)
tdSql
.
error
(
"select * from test.`%s1` ; "
%
self
.
tsdemo
)
tdSql
.
query
(
"show test.tables like '%s_'"
%
self
.
tsdemo
)
tdSql
.
checkRows
(
9
)
try
:
tdSql
.
execute
(
"drop table test.meters "
)
except
Exception
as
e
:
tdLog
.
exit
(
e
)
tdSql
.
error
(
"select * from test.meters "
)
tdSql
.
error
(
"select * from test.`%s2` ; "
%
self
.
tsdemo
)
# Exception
os
.
system
(
"%staosdemo -d test -m %s -t 10 -n 100 -l 10 -y "
%
(
binPath
,
self
.
tsdemo
))
tdSql
.
query
(
"show test.tables "
)
tdSql
.
checkRows
(
0
)
#print("==============taosdemo,#create regular table; insert table; show table; select table; drop table")
self
.
tsdemo
=
"tsdemo~!.@#$%^*[]-_=+{,?.}"
#this escape character is not support in shell . include & () <> | /
os
.
system
(
"%staosdemo -N -E -m %s -t 10 -n 100 -l 10 -y "
%
(
binPath
,
self
.
tsdemo
))
tdSql
.
execute
(
"use test ;"
)
tdSql
.
query
(
"select count(*) from `%s1`"
%
self
.
tsdemo
)
tdSql
.
checkData
(
0
,
0
,
100
)
tdSql
.
query
(
"show test.tables like 'tsdemo%'"
)
tdSql
.
checkRows
(
10
)
tdSql
.
query
(
"show test.tables like '%s_'"
%
self
.
tsdemo
)
tdSql
.
checkRows
(
10
)
tdSql
.
query
(
"select _block_dist() from `%s1`"
%
self
.
tsdemo
)
tdSql
.
checkRows
(
1
)
tdSql
.
query
(
"describe test.`%s1` ; "
%
self
.
tsdemo
)
tdSql
.
checkRows
(
11
)
tdSql
.
query
(
"show create table test.`%s1` ; "
%
self
.
tsdemo
)
tdSql
.
checkData
(
0
,
0
,
self
.
tsdemo
+
str
(
1
))
tdSql
.
checkData
(
0
,
1
,
"create table `%s1` (ts TIMESTAMP,c0 FLOAT,c1 INT,c2 INT,c3 INT,c4 INT,c5 INT,c6 INT,c7 INT,c8 INT,c9 INT)"
%
self
.
tsdemo
)
print
(
"==============drop table\stable"
)
try
:
tdSql
.
execute
(
"drop table test.`%s1` ; "
%
self
.
tsdemo
)
except
Exception
as
e
:
tdLog
.
exit
(
e
)
tdSql
.
error
(
"select * from test.`%s1` ; "
%
self
.
tsdemo
)
tdSql
.
query
(
"show test.tables like '%s_'"
%
self
.
tsdemo
)
tdSql
.
checkRows
(
9
)
# Exception
os
.
system
(
"%staosdemo -N -m %s -t 10 -n 100 -l 10 -y "
%
(
binPath
,
self
.
tsdemo
))
tdSql
.
query
(
"show test.tables "
)
tdSql
.
checkRows
(
0
)
#print("==============taosdemo——json_yes,#create stable,table; insert table; show table; select table; drop table")
os
.
system
(
"%staosdemo -f tools/taosdemoAllTest/TD-10539/create_taosdemo_yes.json -y "
%
binPath
)
tdSql
.
execute
(
"use dbyes"
)
self
.
tsdemo_stable
=
"tsdemo_stable~!.@#$%^*[]-_=+{,?.}"
self
.
tsdemo
=
"tsdemo~!.@#$%^*[]-_=+{,?.}"
tdSql
.
query
(
"select count(*) from dbyes.`%s`"
%
self
.
tsdemo_stable
)
tdSql
.
checkData
(
0
,
0
,
1000
)
tdSql
.
query
(
"show dbyes.tables like 'tsdemo%'"
)
tdSql
.
checkRows
(
10
)
tdSql
.
query
(
"show dbyes.tables like '%s_'"
%
self
.
tsdemo
)
tdSql
.
checkRows
(
10
)
tdSql
.
query
(
"select _block_dist() from `%s1`"
%
self
.
tsdemo
)
tdSql
.
checkRows
(
1
)
tdSql
.
query
(
"describe dbyes.`%s1` ; "
%
self
.
tsdemo
)
tdSql
.
checkRows
(
13
)
tdSql
.
query
(
"show create table dbyes.`%s1` ; "
%
self
.
tsdemo
)
tdSql
.
checkData
(
0
,
0
,
self
.
tsdemo
+
str
(
1
))
tdSql
.
checkData
(
0
,
1
,
"CREATE TABLE `%s1` USING `%s` TAGS (1,1)"
%
(
self
.
tsdemo
,
self
.
tsdemo_stable
))
print
(
"==============drop table\stable"
)
try
:
tdSql
.
execute
(
"drop table dbyes.`%s1` ; "
%
self
.
tsdemo
)
except
Exception
as
e
:
tdLog
.
exit
(
e
)
tdSql
.
error
(
"select * from dbyes.`%s1` ; "
%
self
.
tsdemo
)
tdSql
.
query
(
"show dbyes.tables like '%s_'"
%
self
.
tsdemo
)
tdSql
.
checkRows
(
9
)
try
:
tdSql
.
execute
(
"drop table dbyes.`%s` ; "
%
self
.
tsdemo_stable
)
except
Exception
as
e
:
tdLog
.
exit
(
e
)
tdSql
.
error
(
"select * from dbyes.`%s` ; "
%
self
.
tsdemo_stable
)
tdSql
.
error
(
"select * from dbyes.`%s2` ; "
%
self
.
tsdemo
)
#print("==============taosdemo——json_no,#create stable,table; insert table; show table; select table; drop table")
assert
os
.
system
(
"%staosdemo -f tools/taosdemoAllTest/TD-10539/create_taosdemo_no.json -y "
%
binPath
)
==
0
tdSql
.
query
(
"show dbno.tables "
)
tdSql
.
checkRows
(
0
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/tools/taosdemoAllTest/TD-10539/create_taosdemo_no.json
0 → 100644
浏览文件 @
197bce2c
{
"filetype"
:
"insert"
,
"cfgdir"
:
"/etc/taos"
,
"host"
:
"127.0.0.1"
,
"port"
:
6030
,
"user"
:
"root"
,
"password"
:
"taosdata"
,
"thread_count"
:
10
,
"thread_count_create_tbl"
:
10
,
"result_file"
:
"./insert_res.txt"
,
"confirm_parameter_prompt"
:
"no"
,
"insert_interval"
:
0
,
"interlace_rows"
:
10
,
"num_of_records_per_req"
:
1
,
"max_sql_len"
:
1024000
,
"databases"
:
[{
"dbinfo"
:
{
"name"
:
"dbno"
,
"drop"
:
"yes"
,
"replica"
:
1
,
"days"
:
10
,
"cache"
:
50
,
"blocks"
:
8
,
"precision"
:
"ms"
,
"keep"
:
36500
,
"minRows"
:
100
,
"maxRows"
:
4096
,
"comp"
:
2
,
"walLevel"
:
1
,
"cachelast"
:
0
,
"quorum"
:
1
,
"fsync"
:
3000
,
"update"
:
0
},
"super_tables"
:
[{
"name"
:
"meters"
,
"child_table_exists"
:
"no"
,
"childtable_count"
:
10
,
"childtable_prefix"
:
"tsdemo~!.@#$%^*[]-_=+{,?.}"
,
"escape_character"
:
"no"
,
"auto_create_table"
:
"no"
,
"batch_create_tbl_num"
:
1
,
"data_source"
:
"rand"
,
"insert_mode"
:
"taosc"
,
"insert_rows"
:
100
,
"childtable_limit"
:
0
,
"childtable_offset"
:
0
,
"multi_thread_write_one_tbl"
:
"no"
,
"interlace_rows"
:
0
,
"insert_interval"
:
0
,
"max_sql_len"
:
1024000
,
"disorder_ratio"
:
0
,
"disorder_range"
:
1000
,
"timestamp_step"
:
1
,
"start_timestamp"
:
"2020-10-01 00:00:00.000"
,
"sample_format"
:
"csv"
,
"sample_file"
:
""
,
"tags_file"
:
""
,
"columns"
:
[{
"type"
:
"INT"
,
"count"
:
9
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
1
}],
"tags"
:
[{
"type"
:
"INT"
,
"count"
:
2
}]
}]
}]
}
tests/pytest/tools/taosdemoAllTest/TD-10539/create_taosdemo_yes.json
0 → 100644
浏览文件 @
197bce2c
{
"filetype"
:
"insert"
,
"cfgdir"
:
"/etc/taos"
,
"host"
:
"127.0.0.1"
,
"port"
:
6030
,
"user"
:
"root"
,
"password"
:
"taosdata"
,
"thread_count"
:
5
,
"thread_count_create_tbl"
:
10
,
"result_file"
:
"./insert_res.txt"
,
"confirm_parameter_prompt"
:
"no"
,
"insert_interval"
:
0
,
"interlace_rows"
:
10
,
"num_of_records_per_req"
:
1
,
"max_sql_len"
:
1024000
,
"databases"
:
[{
"dbinfo"
:
{
"name"
:
"dbyes"
,
"drop"
:
"yes"
,
"replica"
:
1
,
"days"
:
10
,
"cache"
:
50
,
"blocks"
:
8
,
"precision"
:
"ms"
,
"keep"
:
36500
,
"minRows"
:
100
,
"maxRows"
:
4096
,
"comp"
:
2
,
"walLevel"
:
1
,
"cachelast"
:
0
,
"quorum"
:
1
,
"fsync"
:
3000
,
"update"
:
0
},
"super_tables"
:
[{
"name"
:
"tsdemo_stable~!.@#$%^*[]-_=+{,?.}"
,
"child_table_exists"
:
"no"
,
"childtable_count"
:
10
,
"childtable_prefix"
:
"tsdemo~!.@#$%^*[]-_=+{,?.}"
,
"escape_character"
:
"yes"
,
"auto_create_table"
:
"no"
,
"batch_create_tbl_num"
:
1
,
"data_source"
:
"rand"
,
"insert_mode"
:
"taosc"
,
"insert_rows"
:
100
,
"childtable_limit"
:
0
,
"childtable_offset"
:
0
,
"multi_thread_write_one_tbl"
:
"no"
,
"interlace_rows"
:
0
,
"insert_interval"
:
0
,
"max_sql_len"
:
1024000
,
"disorder_ratio"
:
0
,
"disorder_range"
:
1000
,
"timestamp_step"
:
1
,
"start_timestamp"
:
"2020-10-01 00:00:00.000"
,
"sample_format"
:
"csv"
,
"sample_file"
:
""
,
"tags_file"
:
""
,
"columns"
:
[{
"type"
:
"INT"
,
"count"
:
9
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
1
}],
"tags"
:
[{
"type"
:
"INT"
,
"count"
:
2
}]
}]
}]
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录