Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5d02a243
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看板
未验证
提交
5d02a243
编写于
9月 01, 2022
作者:
sangshuduo
提交者:
GitHub
9月 01, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: tools/taosdumpTest2.py (#16556)
上级
87c0d49b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
11 deletion
+24
-11
tests/pytest/tools/taosdumpTest2.py
tests/pytest/tools/taosdumpTest2.py
+24
-11
未找到文件。
tests/pytest/tools/taosdumpTest2.py
浏览文件 @
5d02a243
...
@@ -11,15 +11,19 @@
...
@@ -11,15 +11,19 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from
logging.config
import
dictConfig
import
sys
import
sys
import
os
import
os
from
util.log
import
*
from
util.log
import
*
from
util.cases
import
*
from
util.cases
import
*
from
util.sql
import
*
from
util.sql
import
*
from
util.dnodes
import
*
from
util.dnodes
import
*
import
string
import
random
class
TDTestCase
:
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
...
@@ -47,12 +51,19 @@ class TDTestCase:
...
@@ -47,12 +51,19 @@ class TDTestCase:
return
""
return
""
return
paths
[
0
]
return
paths
[
0
]
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
):
def
run
(
self
):
if
not
os
.
path
.
exists
(
"./taosdumptest/tmp"
):
if
not
os
.
path
.
exists
(
"./taosdumptest/tmp"
):
os
.
makedirs
(
"./taosdumptest/tmp"
)
os
.
makedirs
(
"./taosdumptest/tmp"
)
else
:
else
:
os
.
system
(
"rm -rf ./taosdumptest/tmp
"
)
print
(
"directory exists
"
)
os
.
makedirs
(
"./taosdumptest/tmp
"
)
os
.
system
(
"rm -rf ./taosdumptest/tmp/*
"
)
tdSql
.
prepare
()
tdSql
.
prepare
()
...
@@ -76,17 +87,19 @@ class TDTestCase:
...
@@ -76,17 +87,19 @@ class TDTestCase:
tdLog
.
info
(
"taosdump found in %s"
%
binPath
)
tdLog
.
info
(
"taosdump found in %s"
%
binPath
)
os
.
system
(
"rm ./taosdumptest/tmp/*.sql"
)
os
.
system
(
"rm ./taosdumptest/tmp/*.sql"
)
os
.
system
(
"rm ./taosdumptest/tmp/*.avro*"
)
os
.
system
(
"rm -rf ./taosdumptest/taosdump.*"
)
os
.
system
(
os
.
system
(
"%s --databases db -o ./taosdumptest/tmp
-B 32766 -L 1048576
"
%
"%s --databases db -o ./taosdumptest/tmp "
%
binPath
)
binPath
)
tdSql
.
execute
(
"drop database db"
)
tdSql
.
execute
(
"drop database db"
)
tdSql
.
query
(
"s
elect * from information_schema.ins_
databases"
)
tdSql
.
query
(
"s
how
databases"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkRows
(
2
)
os
.
system
(
"%s -i ./taosdumptest/tmp"
%
binPath
)
os
.
system
(
"%s -i ./taosdumptest/tmp
-y
"
%
binPath
)
tdSql
.
query
(
"s
elect * from information_schema.ins_
databases"
)
tdSql
.
query
(
"s
how
databases"
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkData
(
2
,
0
,
'db'
)
tdSql
.
checkData
(
2
,
0
,
'db'
)
...
@@ -105,17 +118,17 @@ class TDTestCase:
...
@@ -105,17 +118,17 @@ class TDTestCase:
"create table stb(ts timestamp, c1 binary(16374), c2 binary(16374), c3 binary(16374)) tags(t1 nchar(256))"
)
"create table stb(ts timestamp, c1 binary(16374), c2 binary(16374), c3 binary(16374)) tags(t1 nchar(256))"
)
tdSql
.
execute
(
tdSql
.
execute
(
"insert into t1 using stb tags('t1') values(now, '%s', '%s', '%s')"
%
"insert into t1 using stb tags('t1') values(now, '%s', '%s', '%s')"
%
(
"16374"
,
(
self
.
generateString
(
16374
)
,
"16374"
,
self
.
generateString
(
16374
)
,
"16374"
))
self
.
generateString
(
16374
)
))
# sys.exit(0)
os
.
system
(
"rm ./taosdumptest/tmp/*.sql"
)
os
.
system
(
"rm ./taosdumptest/tmp/*.sql"
)
os
.
system
(
"rm ./taosdumptest/tmp/*.avro*"
)
os
.
system
(
"rm ./taosdumptest/tmp/*.avro*"
)
os
.
system
(
"rm -rf ./taosdumptest/tmp/taosdump.*"
)
os
.
system
(
"%s -D test -o ./taosdumptest/tmp -y"
%
binPath
)
os
.
system
(
"%s -D test -o ./taosdumptest/tmp -y"
%
binPath
)
tdSql
.
execute
(
"drop database test"
)
tdSql
.
execute
(
"drop database test"
)
tdSql
.
query
(
"s
elect * from information_schema.ins_
databases"
)
tdSql
.
query
(
"s
how
databases"
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkRows
(
3
)
os
.
system
(
"%s -i ./taosdumptest/tmp -y"
%
binPath
)
os
.
system
(
"%s -i ./taosdumptest/tmp -y"
%
binPath
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录