Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e7f7c736
T
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1191
Star
22018
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看板
提交
e7f7c736
编写于
12月 01, 2022
作者:
haoranc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test:add testcase of mnode clusters
上级
e048047e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
33 addition
and
23 deletion
+33
-23
tests/system-test/0-others/compatibility.py
tests/system-test/0-others/compatibility.py
+1
-0
tests/system-test/6-cluster/5dnode3mnodeRestartDnodeInsertData.py
...stem-test/6-cluster/5dnode3mnodeRestartDnodeInsertData.py
+13
-0
tests/system-test/6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py
...test/6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py
+7
-23
tests/system-test/6-cluster/clusterCommonCreate.py
tests/system-test/6-cluster/clusterCommonCreate.py
+12
-0
未找到文件。
tests/system-test/0-others/compatibility.py
浏览文件 @
e7f7c736
...
@@ -68,6 +68,7 @@ class TDTestCase:
...
@@ -68,6 +68,7 @@ class TDTestCase:
my_file
=
Path
(
f
"
{
packagePath
}
/
{
packageName
}
"
)
my_file
=
Path
(
f
"
{
packagePath
}
/
{
packageName
}
"
)
if
not
my_file
.
exists
():
if
not
my_file
.
exists
():
print
(
f
"
{
packageName
}
is not exists"
)
print
(
f
"
{
packageName
}
is not exists"
)
tdLog
.
info
(
f
"cd
{
packagePath
}
&& wget https://www.tdengine.com/assets-download/3.0/
{
packageName
}
"
)
os
.
system
(
f
"cd
{
packagePath
}
&& wget https://www.tdengine.com/assets-download/3.0/
{
packageName
}
"
)
os
.
system
(
f
"cd
{
packagePath
}
&& wget https://www.tdengine.com/assets-download/3.0/
{
packageName
}
"
)
else
:
else
:
print
(
f
"
{
packageName
}
has been exists"
)
print
(
f
"
{
packageName
}
has been exists"
)
...
...
tests/system-test/6-cluster/5dnode3mnodeRestartDnodeInsertData.py
浏览文件 @
e7f7c736
...
@@ -161,6 +161,19 @@ class TDTestCase:
...
@@ -161,6 +161,19 @@ class TDTestCase:
stableName
=
'%s_%d'
%
(
paraDict
[
'stbName'
],
i
)
stableName
=
'%s_%d'
%
(
paraDict
[
'stbName'
],
i
)
newTdSql
=
tdCom
.
newTdSql
()
newTdSql
=
tdCom
.
newTdSql
()
threads
.
append
(
threading
.
Thread
(
target
=
clusterComCreate
.
insert_data
,
args
=
(
newTdSql
,
paraDict
[
"dbName"
],
stableName
,
paraDict
[
"ctbNum"
],
paraDict
[
"rowsPerTbl"
],
paraDict
[
"batchNum"
],
paraDict
[
"startTs"
])))
threads
.
append
(
threading
.
Thread
(
target
=
clusterComCreate
.
insert_data
,
args
=
(
newTdSql
,
paraDict
[
"dbName"
],
stableName
,
paraDict
[
"ctbNum"
],
paraDict
[
"rowsPerTbl"
],
paraDict
[
"batchNum"
],
paraDict
[
"startTs"
])))
for
i
in
range
(
5
):
clusterComCreate
.
createUser
(
newTdSql
,
f
"user
{
i
}
"
,
f
"pass
{
i
}
"
)
userTdSql
=
tdCom
.
newTdSql
(
user
=
f
"user
{
i
}
"
,
password
=
f
"pass
{
i
}
"
)
clusterComCreate
.
alterUser
(
userTdSql
,
f
"user
{
i
}
"
,
f
"pass
{
i
+
1
}
"
)
clusterComCreate
.
deleteUser
(
newTdSql
,
f
"user
{
i
}
"
)
for
j
in
range
(
5
):
i
=
100
clusterComCreate
.
createUser
(
newTdSql
,
f
"user
{
i
}
"
,
f
"pass
{
i
}
"
)
userTdSql
=
tdCom
.
newTdSql
(
user
=
f
"user
{
i
}
"
,
password
=
f
"pass
{
i
}
"
)
clusterComCreate
.
alterUser
(
userTdSql
,
f
"user
{
i
}
"
,
f
"pass
{
i
+
1
}
"
)
clusterComCreate
.
deleteUser
(
newTdSql
,
f
"user
{
i
}
"
)
for
tr
in
threads
:
for
tr
in
threads
:
tr
.
start
()
tr
.
start
()
for
tr
in
threads
:
for
tr
in
threads
:
...
...
tests/system-test/6-cluster/5dnode3mnodeRestartDnodeInsertDataAsync.py
浏览文件 @
e7f7c736
...
@@ -67,29 +67,11 @@ class TDTestCase:
...
@@ -67,29 +67,11 @@ class TDTestCase:
self
.
_async_raise
(
thread
.
ident
,
SystemExit
)
self
.
_async_raise
(
thread
.
ident
,
SystemExit
)
def
insertData
(
self
,
countstart
,
countstop
):
def
reCreateUser
(
self
,
tdsql
,
count
,
user
,
passwd
):
# fisrt add data : db\stable\childtable\general table
clusterComCreate
.
createUser
(
tdsql
,
f
"
{
user
}{
count
}
"
,
f
"
{
passwd
}{
count
}
"
)
userTdSql
=
tdCom
.
newTdSql
(
user
=
f
"
{
user
}{
count
}
"
,
password
=
f
"
{
passwd
}{
count
}
"
)
for
couti
in
range
(
countstart
,
countstop
):
clusterComCreate
.
alterUser
(
userTdSql
,
f
"
{
user
}{
count
}
"
,
f
"
{
passwd
}{
count
+
1
}
"
)
tdLog
.
debug
(
"drop database if exists db%d"
%
couti
)
clusterComCreate
.
deleteUser
(
tdsql
,
f
"
{
user
}{
count
}
"
)
tdSql
.
execute
(
"drop database if exists db%d"
%
couti
)
print
(
"create database if not exists db%d replica 1 duration 300"
%
couti
)
tdSql
.
execute
(
"create database if not exists db%d replica 1 duration 300"
%
couti
)
tdSql
.
execute
(
"use db%d"
%
couti
)
tdSql
.
execute
(
'''create table stb1
(ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp)
tags (t1 int)
'''
)
tdSql
.
execute
(
'''
create table t1
(ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp)
'''
)
for
i
in
range
(
4
):
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags (
{
i
+
1
}
)'
)
def
fiveDnodeThreeMnode
(
self
,
dnodeNumbers
,
mnodeNums
,
restartNumbers
,
stopRole
):
def
fiveDnodeThreeMnode
(
self
,
dnodeNumbers
,
mnodeNums
,
restartNumbers
,
stopRole
):
...
@@ -161,6 +143,8 @@ class TDTestCase:
...
@@ -161,6 +143,8 @@ class TDTestCase:
stableName
=
'%s_%d'
%
(
paraDict
[
'stbName'
],
i
)
stableName
=
'%s_%d'
%
(
paraDict
[
'stbName'
],
i
)
newTdSql
=
tdCom
.
newTdSql
()
newTdSql
=
tdCom
.
newTdSql
()
threads
.
append
(
threading
.
Thread
(
target
=
clusterComCreate
.
insert_data
,
args
=
(
newTdSql
,
paraDict
[
"dbName"
],
stableName
,
paraDict
[
"ctbNum"
],
paraDict
[
"rowsPerTbl"
],
paraDict
[
"batchNum"
],
paraDict
[
"startTs"
])))
threads
.
append
(
threading
.
Thread
(
target
=
clusterComCreate
.
insert_data
,
args
=
(
newTdSql
,
paraDict
[
"dbName"
],
stableName
,
paraDict
[
"ctbNum"
],
paraDict
[
"rowsPerTbl"
],
paraDict
[
"batchNum"
],
paraDict
[
"startTs"
])))
threads
.
append
(
threading
.
Thread
(
target
=
self
.
reCreateUser
,
args
=
(
newTdSql
,
i
,
"user"
,
"passwd"
)))
for
tr
in
threads
:
for
tr
in
threads
:
tr
.
start
()
tr
.
start
()
...
...
tests/system-test/6-cluster/clusterCommonCreate.py
浏览文件 @
e7f7c736
...
@@ -142,7 +142,19 @@ class ClusterComCreate:
...
@@ -142,7 +142,19 @@ class ClusterComCreate:
tsql
.
execute
(
"create database if not exists %s_%d vgroups %d replica %d"
%
(
dbNameIndex
,
1
,
vgroups
,
replica
))
tsql
.
execute
(
"create database if not exists %s_%d vgroups %d replica %d"
%
(
dbNameIndex
,
1
,
vgroups
,
replica
))
tdLog
.
debug
(
"complete to create database %s_%d"
%
(
dbNameIndex
,
1
))
tdLog
.
debug
(
"complete to create database %s_%d"
%
(
dbNameIndex
,
1
))
def
createUser
(
self
,
tsql
,
user
,
password
):
tdLog
.
info
(
f
"create new user f
{
user
}
"
)
tsql
.
execute
(
f
"CREATE USER
{
user
}
PASS '
{
password
}
';"
)
def
alterUser
(
self
,
tsql
,
user
,
password
):
tdLog
.
info
(
f
"alter user
{
user
}
pass '
{
password
}
'"
)
tsql
.
execute
(
f
"alter USER
{
user
}
pass '
{
password
}
' ;"
)
def
deleteUser
(
self
,
tsql
,
user
):
tdLog
.
info
(
f
"drop user f
{
user
}
"
)
tsql
.
execute
(
f
"DROP USER
{
user
}
;"
)
def
create_stable
(
self
,
tsql
,
dbName
,
stbName
):
def
create_stable
(
self
,
tsql
,
dbName
,
stbName
):
tsql
.
execute
(
"create table if not exists %s.%s (ts timestamp, c1 int, c2 int, c3 binary(16)) tags(t1 int, t2 binary(32))"
%
(
dbName
,
stbName
))
tsql
.
execute
(
"create table if not exists %s.%s (ts timestamp, c1 int, c2 int, c3 binary(16)) tags(t1 int, t2 binary(32))"
%
(
dbName
,
stbName
))
tdLog
.
debug
(
"complete to create %s.%s"
%
(
dbName
,
stbName
))
tdLog
.
debug
(
"complete to create %s.%s"
%
(
dbName
,
stbName
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录