Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0c0d6b43
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
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看板
提交
0c0d6b43
编写于
12月 20, 2021
作者:
P
Ping Xiao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TS-932]<test>: add test case for client clientMerge option
上级
2409a9d0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
65 addition
and
5 deletion
+65
-5
tests/pytest/fulltest.sh
tests/pytest/fulltest.sh
+1
-0
tests/pytest/update/updateWithClientMerge.py
tests/pytest/update/updateWithClientMerge.py
+50
-0
tests/pytest/update/update_options.py
tests/pytest/update/update_options.py
+2
-2
tests/pytest/util/dnodes.py
tests/pytest/util/dnodes.py
+12
-3
未找到文件。
tests/pytest/fulltest.sh
浏览文件 @
0c0d6b43
...
@@ -156,6 +156,7 @@ python3 ./test.py -f import_merge/import_update_0.py
...
@@ -156,6 +156,7 @@ python3 ./test.py -f import_merge/import_update_0.py
python3 ./test.py
-f
import_merge/import_update_1.py
python3 ./test.py
-f
import_merge/import_update_1.py
python3 ./test.py
-f
import_merge/import_update_2.py
python3 ./test.py
-f
import_merge/import_update_2.py
python3 ./test.py
-f
update/merge_commit_data.py
python3 ./test.py
-f
update/merge_commit_data.py
python3 ./test.py
-f
update/updateWithClientMerge.py
#======================p1-end===============
#======================p1-end===============
#======================p2-start===============
#======================p2-start===============
# tools
# tools
...
...
tests/pytest/update/updateWithClientMerge.py
0 → 100644
浏览文件 @
0c0d6b43
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import
sys
import
taos
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
from
util.dnodes
import
*
class
TDTestCase
:
updatecfgDict
=
{
'clientMerge'
:
1
}
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
self
.
ts
=
1606700000000
def
run
(
self
):
# TS-932
tdSql
.
execute
(
"create database db3 update 2"
)
tdSql
.
execute
(
"use db3"
)
tdSql
.
execute
(
"drop table if exists tb"
)
tdSql
.
execute
(
"create table tb (ts timestamp, c1 int, c2 int, c3 int)"
)
tdSql
.
execute
(
"insert into tb values(%d, 1, 2, 3)(%d, null, 4, 5)(%d, 6, null, null)"
%
(
self
.
ts
,
self
.
ts
,
self
.
ts
))
tdSql
.
query
(
"select * from tb"
)
tdSql
.
checkData
(
0
,
1
,
6
)
tdSql
.
checkData
(
0
,
2
,
None
)
tdSql
.
checkData
(
0
,
3
,
None
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/update/update_options.py
浏览文件 @
0c0d6b43
...
@@ -20,6 +20,7 @@ from util.dnodes import *
...
@@ -20,6 +20,7 @@ from util.dnodes import *
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
())
tdSql
.
init
(
conn
.
cursor
())
...
@@ -63,7 +64,7 @@ class TDTestCase:
...
@@ -63,7 +64,7 @@ class TDTestCase:
tdLog
.
sleep
(
3
)
tdLog
.
sleep
(
3
)
# test case for https://jira.taosdata.com:18080/browse/TS-402
# test case for https://jira.taosdata.com:18080/browse/TS-402
tdLog
.
info
(
"test case for update option 1"
)
tdLog
.
info
(
"test case for update option 1"
)
tdSql
.
execute
(
"create database test update 1"
)
tdSql
.
execute
(
"create database test update 1"
)
tdSql
.
execute
(
"use test"
)
tdSql
.
execute
(
"use test"
)
...
@@ -109,7 +110,6 @@ class TDTestCase:
...
@@ -109,7 +110,6 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
1
,
6
)
tdSql
.
checkData
(
0
,
1
,
6
)
tdSql
.
checkData
(
0
,
2
,
4
)
tdSql
.
checkData
(
0
,
2
,
4
)
tdSql
.
checkData
(
0
,
3
,
7
)
tdSql
.
checkData
(
0
,
3
,
7
)
def
stop
(
self
):
def
stop
(
self
):
tdSql
.
close
()
tdSql
.
close
()
...
...
tests/pytest/util/dnodes.py
浏览文件 @
0c0d6b43
...
@@ -64,10 +64,12 @@ class TDSimClient:
...
@@ -64,10 +64,12 @@ class TDSimClient:
cmd
=
"echo %s %s >> %s"
%
(
option
,
value
,
self
.
cfgPath
)
cmd
=
"echo %s %s >> %s"
%
(
option
,
value
,
self
.
cfgPath
)
if
os
.
system
(
cmd
)
!=
0
:
if
os
.
system
(
cmd
)
!=
0
:
tdLog
.
exit
(
cmd
)
tdLog
.
exit
(
cmd
)
def
os_string
(
self
,
path
):
def
os_string
(
self
,
path
):
os_path
=
path
.
replace
(
"/"
,
os
.
sep
)
os_path
=
path
.
replace
(
"/"
,
os
.
sep
)
return
os_path
return
os_path
def
deploy
(
self
):
def
deploy
(
self
,
*
updatecfgDict
):
self
.
logDir
=
self
.
os_string
(
"%s/sim/psim/log"
%
(
self
.
path
))
self
.
logDir
=
self
.
os_string
(
"%s/sim/psim/log"
%
(
self
.
path
))
self
.
cfgDir
=
self
.
os_string
(
"%s/sim/psim/cfg"
%
(
self
.
path
))
self
.
cfgDir
=
self
.
os_string
(
"%s/sim/psim/cfg"
%
(
self
.
path
))
self
.
cfgPath
=
self
.
os_string
(
"%s/sim/psim/cfg/taos.cfg"
%
(
self
.
path
))
self
.
cfgPath
=
self
.
os_string
(
"%s/sim/psim/cfg/taos.cfg"
%
(
self
.
path
))
...
@@ -107,6 +109,13 @@ class TDSimClient:
...
@@ -107,6 +109,13 @@ class TDSimClient:
self
.
cfg
(
"masterIp"
,
"192.168.0.1"
)
self
.
cfg
(
"masterIp"
,
"192.168.0.1"
)
self
.
cfg
(
"secondIp"
,
"192.168.0.2"
)
self
.
cfg
(
"secondIp"
,
"192.168.0.2"
)
self
.
cfg
(
"logDir"
,
self
.
logDir
)
self
.
cfg
(
"logDir"
,
self
.
logDir
)
# update extra client config
clientCfgkeys
=
[
"clientMerge"
]
if
updatecfgDict
[
0
]
and
updatecfgDict
[
0
][
0
]:
for
key
,
value
in
updatecfgDict
[
0
][
0
].
items
():
if
key
in
clientCfgkeys
:
self
.
cfg
(
key
,
value
)
for
key
,
value
in
self
.
cfgDict
.
items
():
for
key
,
value
in
self
.
cfgDict
.
items
():
self
.
cfg
(
key
,
value
)
self
.
cfg
(
key
,
value
)
...
@@ -240,7 +249,7 @@ class TDDnode:
...
@@ -240,7 +249,7 @@ class TDDnode:
else
:
else
:
self
.
cfg
(
value
,
key
)
self
.
cfg
(
value
,
key
)
else
:
else
:
self
.
addExtraCfg
(
key
,
value
)
self
.
addExtraCfg
(
key
,
value
)
for
key
,
value
in
self
.
cfgDict
.
items
():
for
key
,
value
in
self
.
cfgDict
.
items
():
self
.
cfg
(
key
,
value
)
self
.
cfg
(
key
,
value
)
...
@@ -505,7 +514,7 @@ class TDDnodes:
...
@@ -505,7 +514,7 @@ class TDDnodes:
self
.
sim
.
setTestCluster
(
self
.
testCluster
)
self
.
sim
.
setTestCluster
(
self
.
testCluster
)
if
(
self
.
simDeployed
==
False
):
if
(
self
.
simDeployed
==
False
):
self
.
sim
.
deploy
()
self
.
sim
.
deploy
(
updatecfgDict
)
self
.
simDeployed
=
True
self
.
simDeployed
=
True
self
.
check
(
index
)
self
.
check
(
index
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录