Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
loser646
TDengine
提交
2f7644b4
T
TDengine
项目概览
loser646
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2f7644b4
编写于
5月 15, 2020
作者:
S
Shuduo Sang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix autopep8 format.
上级
35f5a204
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
261 addition
and
69 deletion
+261
-69
tests/pytest/dbmgmt/database-name-boundary.py
tests/pytest/dbmgmt/database-name-boundary.py
+3
-3
tests/pytest/insert/binary-boundary.py
tests/pytest/insert/binary-boundary.py
+86
-10
tests/pytest/insert/nchar-boundary.py
tests/pytest/insert/nchar-boundary.py
+15
-1
tests/pytest/insert/nchar-unicode.py
tests/pytest/insert/nchar-unicode.py
+127
-40
tests/pytest/query/query.py
tests/pytest/query/query.py
+1
-1
tests/pytest/stable/insert.py
tests/pytest/stable/insert.py
+1
-1
tests/pytest/table/tablename-boundary.py
tests/pytest/table/tablename-boundary.py
+10
-4
tests/pytest/tag_lite/create-tags-boundary.py
tests/pytest/tag_lite/create-tags-boundary.py
+14
-6
tests/pytest/util/dnodes.py
tests/pytest/util/dnodes.py
+4
-3
未找到文件。
tests/pytest/dbmgmt/database-name-boundary.py
浏览文件 @
2f7644b4
...
...
@@ -29,14 +29,14 @@ class TDTestCase:
def
run
(
self
):
chars
=
string
.
ascii_uppercase
+
string
.
ascii_lowercase
chars
=
string
.
ascii_uppercase
+
string
.
ascii_lowercase
getDbNameLen
=
"grep -w '#define TSDB_DB_NAME_LEN' ../../src/inc/taosdef.h|awk '{print $3}'"
dbNameMaxLen
=
int
(
subprocess
.
check_output
(
getDbNameLen
,
shell
=
True
))
tdLog
.
notice
(
"DB name max length is %d"
%
dbNameMaxLen
)
tdLog
.
info
(
"=============== step1"
)
db_name
=
''
.
join
(
random
.
choices
(
chars
,
k
=
(
dbNameMaxLen
+
1
)))
db_name
=
''
.
join
(
random
.
choices
(
chars
,
k
=
(
dbNameMaxLen
+
1
)))
tdLog
.
info
(
'db_name length %d'
%
len
(
db_name
))
tdLog
.
info
(
'create database %s'
%
db_name
)
tdSql
.
error
(
'create database %s'
%
db_name
)
...
...
@@ -52,7 +52,7 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
db_name
.
lower
())
tdLog
.
info
(
"=============== step3"
)
db_name
=
''
.
join
(
random
.
choices
(
chars
,
k
=
(
dbNameMaxLen
-
1
)))
db_name
=
''
.
join
(
random
.
choices
(
chars
,
k
=
(
dbNameMaxLen
-
1
)))
tdLog
.
info
(
'db_name length %d'
%
len
(
db_name
))
tdLog
.
info
(
'create database %s'
%
db_name
)
tdSql
.
execute
(
'create database %s'
%
db_name
)
...
...
tests/pytest/insert/binary-boundary.py
浏览文件 @
2f7644b4
...
...
@@ -25,7 +25,21 @@ class TDTestCase:
tdSql
.
error
(
"insert into tb values (now, )"
)
with
open
(
"../../README.md"
,
"r"
)
as
inputFile
:
data
=
inputFile
.
read
(
4084
).
replace
(
"
\n
"
,
" "
).
replace
(
"
\\
"
,
" "
).
replace
(
"
\'
"
,
" "
).
replace
(
"
\"
"
,
" "
).
replace
(
"["
,
" "
).
replace
(
"]"
,
" "
).
replace
(
"!"
,
" "
)
data
=
inputFile
.
read
(
4084
).
replace
(
"
\n
"
,
" "
).
replace
(
"
\\
"
,
" "
).
replace
(
"
\'
"
,
" "
).
replace
(
"
\"
"
,
" "
).
replace
(
"["
,
" "
).
replace
(
"]"
,
" "
).
replace
(
"!"
,
" "
)
tdLog
.
info
(
"insert %d length data: %s"
%
(
len
(
data
),
data
))
...
...
@@ -39,17 +53,79 @@ class TDTestCase:
tdLog
.
info
(
"tdSql.checkData(0, 1, '%s')"
%
data
)
tdSql
.
checkData
(
0
,
1
,
data
)
tdLog
.
info
(
'create table tb2 (ts timestamp, speed binary(2040), temp binary(2044))'
)
tdSql
.
execute
(
'create table tb2 (ts timestamp, speed binary(2040), temp binary(2044))'
)
speed
=
inputFile
.
read
(
2044
).
replace
(
"
\n
"
,
" "
).
replace
(
"
\\
"
,
" "
).
replace
(
"
\'
"
,
" "
).
replace
(
"
\"
"
,
" "
).
replace
(
"["
,
" "
).
replace
(
"]"
,
" "
).
replace
(
"!"
,
" "
)
temp
=
inputFile
.
read
(
2040
).
replace
(
"
\n
"
,
" "
).
replace
(
"
\\
"
,
" "
).
replace
(
"
\'
"
,
" "
).
replace
(
"
\"
"
,
" "
).
replace
(
"["
,
" "
).
replace
(
"]"
,
" "
).
replace
(
"!"
,
" "
)
tdLog
.
info
(
'create table tb2 (ts timestamp, speed binary(2040), temp binary(2044))'
)
tdSql
.
execute
(
'create table tb2 (ts timestamp, speed binary(2040), temp binary(2044))'
)
speed
=
inputFile
.
read
(
2044
).
replace
(
"
\n
"
,
" "
).
replace
(
"
\\
"
,
" "
).
replace
(
"
\'
"
,
" "
).
replace
(
"
\"
"
,
" "
).
replace
(
"["
,
" "
).
replace
(
"]"
,
" "
).
replace
(
"!"
,
" "
)
temp
=
inputFile
.
read
(
2040
).
replace
(
"
\n
"
,
" "
).
replace
(
"
\\
"
,
" "
).
replace
(
"
\'
"
,
" "
).
replace
(
"
\"
"
,
" "
).
replace
(
"["
,
" "
).
replace
(
"]"
,
" "
).
replace
(
"!"
,
" "
)
tdLog
.
info
(
"insert into tb values (now+3a, speed, temp)"
)
tdSql
.
error
(
"insert into tb values (now+3a, '%s', '%s')"
%
(
speed
,
temp
))
speed
=
inputFile
.
read
(
2040
).
replace
(
"
\n
"
,
" "
).
replace
(
"
\\
"
,
" "
).
replace
(
"
\'
"
,
" "
).
replace
(
"
\"
"
,
" "
).
replace
(
"["
,
" "
).
replace
(
"]"
,
" "
).
replace
(
"!"
,
" "
)
temp
=
inputFile
.
read
(
2044
).
replace
(
"
\n
"
,
" "
).
replace
(
"
\\
"
,
" "
).
replace
(
"
\'
"
,
" "
).
replace
(
"
\"
"
,
" "
).
replace
(
"["
,
" "
).
replace
(
"]"
,
" "
).
replace
(
"!"
,
" "
)
tdSql
.
error
(
"insert into tb values (now+3a, '%s', '%s')"
%
(
speed
,
temp
))
speed
=
inputFile
.
read
(
2040
).
replace
(
"
\n
"
,
" "
).
replace
(
"
\\
"
,
" "
).
replace
(
"
\'
"
,
" "
).
replace
(
"
\"
"
,
" "
).
replace
(
"["
,
" "
).
replace
(
"]"
,
" "
).
replace
(
"!"
,
" "
)
temp
=
inputFile
.
read
(
2044
).
replace
(
"
\n
"
,
" "
).
replace
(
"
\\
"
,
" "
).
replace
(
"
\'
"
,
" "
).
replace
(
"
\"
"
,
" "
).
replace
(
"["
,
" "
).
replace
(
"]"
,
" "
).
replace
(
"!"
,
" "
)
tdLog
.
info
(
"insert into tb values (now+4a, speed, temp)"
)
tdSql
.
error
(
"insert into tb values (now+4a, '%s', '%s')"
%
(
speed
,
temp
))
tdSql
.
error
(
"insert into tb values (now+4a, '%s', '%s')"
%
(
speed
,
temp
))
tdLog
.
info
(
'tdSql.checkRow(2)'
)
tdSql
.
checkRows
(
2
)
...
...
tests/pytest/insert/nchar-boundary.py
浏览文件 @
2f7644b4
...
...
@@ -33,7 +33,21 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
1
,
'taosdata'
)
with
open
(
"../../README.md"
,
"r"
)
as
inputFile
:
data
=
inputFile
.
read
(
1021
).
replace
(
"
\n
"
,
" "
).
replace
(
"
\\
"
,
" "
).
replace
(
"
\'
"
,
" "
).
replace
(
"
\"
"
,
" "
).
replace
(
"["
,
" "
).
replace
(
"]"
,
" "
).
replace
(
"!"
,
" "
)
data
=
inputFile
.
read
(
1021
).
replace
(
"
\n
"
,
" "
).
replace
(
"
\\
"
,
" "
).
replace
(
"
\'
"
,
" "
).
replace
(
"
\"
"
,
" "
).
replace
(
"["
,
" "
).
replace
(
"]"
,
" "
).
replace
(
"!"
,
" "
)
tdLog
.
info
(
"insert %d length data: %s"
%
(
len
(
data
),
data
))
...
...
tests/pytest/insert/nchar-unicode.py
浏览文件 @
2f7644b4
此差异已折叠。
点击以展开。
tests/pytest/query/query.py
浏览文件 @
2f7644b4
...
...
@@ -37,7 +37,7 @@ class TDTestCase:
print
(
"==============step2"
)
tdSql
.
execute
(
"""INSERT INTO dev_001(ts, tagtype) VALUES('2020-05-13 10:00:00.000', 1),
"""INSERT INTO dev_001(ts, tagtype) VALUES('2020-05-13 10:00:00.000', 1),
('2020-05-13 10:00:00.001', 1)
dev_002 VALUES('2020-05-13 10:00:00.001', 1)"""
)
...
...
tests/pytest/stable/insert.py
浏览文件 @
2f7644b4
...
...
@@ -37,7 +37,7 @@ class TDTestCase:
print
(
"==============step2"
)
tdSql
.
execute
(
"""INSERT INTO dev_001(ts, tagtype) VALUES('2020-05-13 10:00:00.000', 1),
"""INSERT INTO dev_001(ts, tagtype) VALUES('2020-05-13 10:00:00.000', 1),
('2020-05-13 10:00:00.001', 1)
dev_002 VALUES('2020-05-13 10:00:00.001', 1)"""
)
...
...
tests/pytest/table/tablename-boundary.py
浏览文件 @
2f7644b4
...
...
@@ -18,18 +18,24 @@ class TDTestCase:
tdSql
.
prepare
()
getTableNameLen
=
"grep -w '#define TSDB_TABLE_NAME_LEN' ../../src/inc/taosdef.h|awk '{print $3}'"
tableNameMaxLen
=
int
(
subprocess
.
check_output
(
getTableNameLen
,
shell
=
True
))
tableNameMaxLen
=
int
(
subprocess
.
check_output
(
getTableNameLen
,
shell
=
True
))
tdLog
.
notice
(
"table name max length is %d"
%
tableNameMaxLen
)
chars
=
string
.
ascii_uppercase
+
string
.
ascii_lowercase
chars
=
string
.
ascii_uppercase
+
string
.
ascii_lowercase
tb_name
=
''
.
join
(
random
.
choices
(
chars
,
k
=
tableNameMaxLen
))
tdLog
.
info
(
'tb_name length %d'
%
len
(
tb_name
))
tdLog
.
info
(
'create table %s (ts timestamp, value int)'
%
tb_name
)
tdSql
.
error
(
'create table %s (ts timestamp, speed binary(4089))'
%
tb_name
)
tdSql
.
error
(
'create table %s (ts timestamp, speed binary(4089))'
%
tb_name
)
tb_name
=
''
.
join
(
random
.
choices
(
chars
,
k
=
191
))
tdLog
.
info
(
'tb_name length %d'
%
len
(
tb_name
))
tdLog
.
info
(
'create table %s (ts timestamp, value int)'
%
tb_name
)
tdSql
.
execute
(
'create table %s (ts timestamp, speed binary(4089))'
%
tb_name
)
tdSql
.
execute
(
'create table %s (ts timestamp, speed binary(4089))'
%
tb_name
)
def
stop
(
self
):
tdSql
.
close
()
...
...
tests/pytest/tag_lite/create-tags-boundary.py
浏览文件 @
2f7644b4
...
...
@@ -33,19 +33,27 @@ class TDTestCase:
stb_name
=
"stb%d"
%
x
tagSeq
=
"tag0 int"
for
y
in
range
(
1
,
x
+
1
):
for
y
in
range
(
1
,
x
+
1
):
tagSeq
=
tagSeq
+
", tag%d int"
%
y
tdLog
.
info
(
"create table %s (ts timestamp, value int) tags (%s)"
%
(
stb_name
,
tagSeq
))
tdSql
.
execute
(
"create table %s (ts timestamp, value int) tags (%s)"
%
(
stb_name
,
tagSeq
))
tdLog
.
info
(
"create table %s (ts timestamp, value int) tags (%s)"
%
(
stb_name
,
tagSeq
))
tdSql
.
execute
(
"create table %s (ts timestamp, value int) tags (%s)"
%
(
stb_name
,
tagSeq
))
tdSql
.
query
(
"show stables"
)
tdSql
.
checkRows
(
boundary
)
stb_name
=
"stb%d"
%
(
boundary
+
1
)
stb_name
=
"stb%d"
%
(
boundary
+
1
)
tagSeq
=
tagSeq
+
", tag%d int"
%
(
boundary
)
tdLog
.
info
(
"create table %s (ts timestamp, value int) tags (%s)"
%
(
stb_name
,
tagSeq
))
tdSql
.
error
(
"create table %s (ts timestamp, value int) tags (%s)"
%
(
stb_name
,
tagSeq
))
tdLog
.
info
(
"create table %s (ts timestamp, value int) tags (%s)"
%
(
stb_name
,
tagSeq
))
tdSql
.
error
(
"create table %s (ts timestamp, value int) tags (%s)"
%
(
stb_name
,
tagSeq
))
tdSql
.
query
(
"show stables"
)
tdSql
.
checkRows
(
boundary
)
...
...
tests/pytest/util/dnodes.py
浏览文件 @
2f7644b4
...
...
@@ -103,7 +103,8 @@ class TDDnode:
self
.
logDir
=
"%s/pysim/dnode%d/log"
%
(
self
.
path
,
self
.
index
)
self
.
dataDir
=
"%s/pysim/dnode%d/data"
%
(
self
.
path
,
self
.
index
)
self
.
cfgDir
=
"%s/pysim/dnode%d/cfg"
%
(
self
.
path
,
self
.
index
)
self
.
cfgPath
=
"%s/pysim/dnode%d/cfg/taos.cfg"
%
(
self
.
path
,
self
.
index
)
self
.
cfgPath
=
"%s/pysim/dnode%d/cfg/taos.cfg"
%
(
self
.
path
,
self
.
index
)
cmd
=
"rm -rf "
+
self
.
dataDir
if
os
.
system
(
cmd
)
!=
0
:
...
...
@@ -188,7 +189,7 @@ class TDDnode:
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"community"
not
in
rootRealPath
):
binPath
=
os
.
path
.
join
(
root
,
"taosd"
)
break
;
break
else
:
projPath
=
selfPath
+
"/../../../"
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
...
...
@@ -196,7 +197,7 @@ class TDDnode:
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
binPath
=
os
.
path
.
join
(
root
,
"taosd"
)
break
;
break
if
(
binPath
==
""
):
tdLog
.
exit
(
"taosd not found!s"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录