Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5d02a243
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
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 @@
# -*- coding: utf-8 -*-
from
logging.config
import
dictConfig
import
sys
import
os
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
from
util.dnodes
import
*
import
string
import
random
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
...
...
@@ -47,12 +51,19 @@ class TDTestCase:
return
""
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
):
if
not
os
.
path
.
exists
(
"./taosdumptest/tmp"
):
os
.
makedirs
(
"./taosdumptest/tmp"
)
else
:
os
.
system
(
"rm -rf ./taosdumptest/tmp
"
)
os
.
makedirs
(
"./taosdumptest/tmp
"
)
print
(
"directory exists
"
)
os
.
system
(
"rm -rf ./taosdumptest/tmp/*
"
)
tdSql
.
prepare
()
...
...
@@ -76,17 +87,19 @@ class TDTestCase:
tdLog
.
info
(
"taosdump found in %s"
%
binPath
)
os
.
system
(
"rm ./taosdumptest/tmp/*.sql"
)
os
.
system
(
"rm ./taosdumptest/tmp/*.avro*"
)
os
.
system
(
"rm -rf ./taosdumptest/taosdump.*"
)
os
.
system
(
"%s --databases db -o ./taosdumptest/tmp
-B 32766 -L 1048576
"
%
"%s --databases db -o ./taosdumptest/tmp "
%
binPath
)
tdSql
.
execute
(
"drop database db"
)
tdSql
.
query
(
"s
elect * from information_schema.ins_
databases"
)
tdSql
.
query
(
"s
how
databases"
)
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
.
checkData
(
2
,
0
,
'db'
)
...
...
@@ -105,17 +118,17 @@ class TDTestCase:
"create table stb(ts timestamp, c1 binary(16374), c2 binary(16374), c3 binary(16374)) tags(t1 nchar(256))"
)
tdSql
.
execute
(
"insert into t1 using stb tags('t1') values(now, '%s', '%s', '%s')"
%
(
"16374"
,
"16374"
,
"16374"
))
(
self
.
generateString
(
16374
)
,
self
.
generateString
(
16374
)
,
self
.
generateString
(
16374
)
))
# sys.exit(0)
os
.
system
(
"rm ./taosdumptest/tmp/*.sql"
)
os
.
system
(
"rm ./taosdumptest/tmp/*.avro*"
)
os
.
system
(
"rm -rf ./taosdumptest/tmp/taosdump.*"
)
os
.
system
(
"%s -D test -o ./taosdumptest/tmp -y"
%
binPath
)
tdSql
.
execute
(
"drop database test"
)
tdSql
.
query
(
"s
elect * from information_schema.ins_
databases"
)
tdSql
.
query
(
"s
how
databases"
)
tdSql
.
checkRows
(
3
)
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录