Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
837cf038
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
837cf038
编写于
3月 08, 2022
作者:
P
Ping Xiao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TS-1289][TS-1255][TS-1286]: add test cases
上级
c11c8092
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
54 addition
and
2 deletion
+54
-2
src/kit/taos-tools
src/kit/taos-tools
+1
-1
tests/pytest/table/create_db_from_normal_db.py
tests/pytest/table/create_db_from_normal_db.py
+20
-1
tests/pytest/tools/taosdumpTest2.py
tests/pytest/tools/taosdumpTest2.py
+33
-0
未找到文件。
taos-tools
@
c7895975
比较
14fb199c
...
c7895975
Subproject commit
14fb199c68ed7d32d616cd9be231b332ceae991
1
Subproject commit
c7895975ca625b6380a48211c7b9102f967f645
1
tests/pytest/table/create_db_from_normal_db.py
浏览文件 @
837cf038
...
...
@@ -34,7 +34,26 @@ class TDTestCase:
tdSql
.
execute
(
"drop table if exists db.state2;"
)
tdSql
.
execute
(
"create table db.state2 (ts timestamp, c1 int) tags (t binary(20));"
)
tdSql
.
query
(
"create table db.test2 using db.state2 tags('tt');"
)
tdSql
.
error
(
"create table db.test22 using db.test2 tags('tt');"
)
tdSql
.
error
(
"create table db.test22 using db.test2 tags('tt');"
)
# test case for TS-1289
tdSql
.
execute
(
"create database test"
)
tdSql
.
execute
(
"use test"
)
tdSql
.
execute
(
"create table `metrics` (`ts` TIMESTAMP,`value` DOUBLE) TAGS (`labels` JSON)"
)
tdSql
.
execute
(
'''CREATE TABLE `t_eb22c740776471c56ed97eff4951eb41` USING `metrics` TAGS ('{"__name__":"node_exporter:memory:used:percent","datacenter":"cvte
","hostname":"p-tdengine-s-002","instance":"10.21.46.53:9100","ipaddress":"10.21.46.53","job":"node","product":"Prometheus","productline":"INFRA
"}');'''
)
tdSql
.
query
(
"show create table t_eb22c740776471c56ed97eff4951eb41"
)
sql
=
tdSql
.
getData
(
0
,
1
)
tdSql
.
execute
(
"drop table t_eb22c740776471c56ed97eff4951eb41"
)
tdSql
.
query
(
"show tables"
)
tdSql
.
checkRows
(
0
)
tdSql
.
execute
(
sql
)
tdSql
.
query
(
"show tables"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
't_eb22c740776471c56ed97eff4951eb41'
)
def
stop
(
self
):
tdSql
.
close
()
...
...
tests/pytest/tools/taosdumpTest2.py
浏览文件 @
837cf038
...
...
@@ -17,6 +17,8 @@ from util.log import *
from
util.cases
import
*
from
util.sql
import
*
from
util.dnodes
import
*
import
string
import
random
class
TDTestCase
:
...
...
@@ -44,6 +46,13 @@ class TDTestCase:
break
return
buildPath
def
generateString
(
self
,
length
):
chars
=
string
.
ascii_uppercase
+
string
.
ascii_lowercase
v
=
""
for
i
in
range
(
length
):
v
+=
random
.
choice
(
chars
)
return
v
def
run
(
self
):
tdSql
.
prepare
()
...
...
@@ -91,6 +100,30 @@ class TDTestCase:
tdSql
.
query
(
"select count(*) from t1"
)
tdSql
.
checkData
(
0
,
0
,
self
.
numberOfRecords
)
tdSql
.
execute
(
"create database test"
)
tdSql
.
execute
(
"use test"
)
tdSql
.
execute
(
"create table stb(ts timestamp, c1 binary(16000), c2 binary(16000), c3 binary(10000)) tags(t1 nchar(256))"
)
tdSql
.
execute
(
"insert into t1 using stb tags('t1') values(now, '%s', '%s', '%s')"
%
(
self
.
generateString
(
16000
),
self
.
generateString
(
16000
),
self
.
generateString
(
10000
)))
os
.
system
(
"rm /tmp/*.sql"
)
os
.
system
(
"rm /tmp/*.avro*"
)
os
.
system
(
"%staosdump -D test -o /tmp"
%
binPath
)
tdSql
.
execute
(
"drop database test"
)
tdSql
.
query
(
"show databases"
)
tdSql
.
checkRows
(
0
)
os
.
system
(
"%staosdump -i /tmp"
%
binPath
)
tdSql
.
execute
(
"use test"
)
tdSql
.
error
(
"show vnodes '' "
)
tdSql
.
query
(
"show stables"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
'stb'
)
tdSql
.
query
(
"select * from stb"
)
tdSql
.
checkRows
(
1
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录