Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yiicenne
TDengine
提交
fd76b5f7
TDengine
项目概览
yiicenne
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fd76b5f7
编写于
4月 27, 2020
作者:
sangshuduo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
port import_merge python testcase for 2.0
[TD-205]
上级
905e2820
变更
71
隐藏空白更改
内联
并排
Showing
71 changed file
with
5149 addition
and
5 deletion
+5149
-5
.travis.yml
.travis.yml
+3
-4
tests/pytest/fulltest.sh
tests/pytest/fulltest.sh
+75
-0
tests/pytest/import_merge/__init__.py
tests/pytest/import_merge/__init__.py
+0
-0
tests/pytest/import_merge/importBlock1H.py
tests/pytest/import_merge/importBlock1H.py
+70
-0
tests/pytest/import_merge/importBlock1HO.py
tests/pytest/import_merge/importBlock1HO.py
+73
-0
tests/pytest/import_merge/importBlock1HPO.py
tests/pytest/import_merge/importBlock1HPO.py
+75
-0
tests/pytest/import_merge/importBlock1S.py
tests/pytest/import_merge/importBlock1S.py
+73
-0
tests/pytest/import_merge/importBlock1Sub.py
tests/pytest/import_merge/importBlock1Sub.py
+73
-0
tests/pytest/import_merge/importBlock1T.py
tests/pytest/import_merge/importBlock1T.py
+70
-0
tests/pytest/import_merge/importBlock1TO.py
tests/pytest/import_merge/importBlock1TO.py
+73
-0
tests/pytest/import_merge/importBlock1TPO.py
tests/pytest/import_merge/importBlock1TPO.py
+75
-0
tests/pytest/import_merge/importBlock2H.py
tests/pytest/import_merge/importBlock2H.py
+70
-0
tests/pytest/import_merge/importBlock2HO.py
tests/pytest/import_merge/importBlock2HO.py
+73
-0
tests/pytest/import_merge/importBlock2HPO.py
tests/pytest/import_merge/importBlock2HPO.py
+75
-0
tests/pytest/import_merge/importBlock2S.py
tests/pytest/import_merge/importBlock2S.py
+73
-0
tests/pytest/import_merge/importBlock2Sub.py
tests/pytest/import_merge/importBlock2Sub.py
+73
-0
tests/pytest/import_merge/importBlock2T.py
tests/pytest/import_merge/importBlock2T.py
+70
-0
tests/pytest/import_merge/importBlock2TO.py
tests/pytest/import_merge/importBlock2TO.py
+73
-0
tests/pytest/import_merge/importBlock2TPO.py
tests/pytest/import_merge/importBlock2TPO.py
+75
-0
tests/pytest/import_merge/importBlockbetween.py
tests/pytest/import_merge/importBlockbetween.py
+76
-0
tests/pytest/import_merge/importCacheFileH.py
tests/pytest/import_merge/importCacheFileH.py
+86
-0
tests/pytest/import_merge/importCacheFileHO.py
tests/pytest/import_merge/importCacheFileHO.py
+89
-0
tests/pytest/import_merge/importCacheFileHPO.py
tests/pytest/import_merge/importCacheFileHPO.py
+91
-0
tests/pytest/import_merge/importCacheFileS.py
tests/pytest/import_merge/importCacheFileS.py
+89
-0
tests/pytest/import_merge/importCacheFileSub.py
tests/pytest/import_merge/importCacheFileSub.py
+89
-0
tests/pytest/import_merge/importCacheFileT.py
tests/pytest/import_merge/importCacheFileT.py
+86
-0
tests/pytest/import_merge/importCacheFileTO.py
tests/pytest/import_merge/importCacheFileTO.py
+89
-0
tests/pytest/import_merge/importCacheFileTPO.py
tests/pytest/import_merge/importCacheFileTPO.py
+91
-0
tests/pytest/import_merge/importDataH2.py
tests/pytest/import_merge/importDataH2.py
+91
-0
tests/pytest/import_merge/importDataHO.py
tests/pytest/import_merge/importDataHO.py
+80
-0
tests/pytest/import_merge/importDataHO2.py
tests/pytest/import_merge/importDataHO2.py
+80
-0
tests/pytest/import_merge/importDataHPO.py
tests/pytest/import_merge/importDataHPO.py
+82
-0
tests/pytest/import_merge/importDataLastH.py
tests/pytest/import_merge/importDataLastH.py
+76
-0
tests/pytest/import_merge/importDataLastHO.py
tests/pytest/import_merge/importDataLastHO.py
+79
-0
tests/pytest/import_merge/importDataLastHPO.py
tests/pytest/import_merge/importDataLastHPO.py
+81
-0
tests/pytest/import_merge/importDataLastS.py
tests/pytest/import_merge/importDataLastS.py
+79
-0
tests/pytest/import_merge/importDataLastSub.py
tests/pytest/import_merge/importDataLastSub.py
+79
-0
tests/pytest/import_merge/importDataLastT.py
tests/pytest/import_merge/importDataLastT.py
+72
-0
tests/pytest/import_merge/importDataLastTO.py
tests/pytest/import_merge/importDataLastTO.py
+75
-0
tests/pytest/import_merge/importDataLastTPO.py
tests/pytest/import_merge/importDataLastTPO.py
+77
-0
tests/pytest/import_merge/importDataS.py
tests/pytest/import_merge/importDataS.py
+75
-0
tests/pytest/import_merge/importDataSub.py
tests/pytest/import_merge/importDataSub.py
+80
-0
tests/pytest/import_merge/importDataT.py
tests/pytest/import_merge/importDataT.py
+72
-0
tests/pytest/import_merge/importDataTO.py
tests/pytest/import_merge/importDataTO.py
+75
-0
tests/pytest/import_merge/importDataTPO.py
tests/pytest/import_merge/importDataTPO.py
+78
-0
tests/pytest/import_merge/importHORestart.py
tests/pytest/import_merge/importHORestart.py
+66
-0
tests/pytest/import_merge/importHPORestart.py
tests/pytest/import_merge/importHPORestart.py
+69
-0
tests/pytest/import_merge/importHRestart.py
tests/pytest/import_merge/importHRestart.py
+65
-0
tests/pytest/import_merge/importHead.py
tests/pytest/import_merge/importHead.py
+68
-0
tests/pytest/import_merge/importHeadOverlap.py
tests/pytest/import_merge/importHeadOverlap.py
+63
-0
tests/pytest/import_merge/importHeadPartOverlap.py
tests/pytest/import_merge/importHeadPartOverlap.py
+67
-0
tests/pytest/import_merge/importLastH.py
tests/pytest/import_merge/importLastH.py
+72
-0
tests/pytest/import_merge/importLastHO.py
tests/pytest/import_merge/importLastHO.py
+75
-0
tests/pytest/import_merge/importLastHPO.py
tests/pytest/import_merge/importLastHPO.py
+77
-0
tests/pytest/import_merge/importLastS.py
tests/pytest/import_merge/importLastS.py
+74
-0
tests/pytest/import_merge/importLastSub.py
tests/pytest/import_merge/importLastSub.py
+75
-0
tests/pytest/import_merge/importLastT.py
tests/pytest/import_merge/importLastT.py
+76
-0
tests/pytest/import_merge/importLastTO.py
tests/pytest/import_merge/importLastTO.py
+79
-0
tests/pytest/import_merge/importLastTPO.py
tests/pytest/import_merge/importLastTPO.py
+80
-0
tests/pytest/import_merge/importSRestart.py
tests/pytest/import_merge/importSRestart.py
+73
-0
tests/pytest/import_merge/importSpan.py
tests/pytest/import_merge/importSpan.py
+68
-0
tests/pytest/import_merge/importSubRestart.py
tests/pytest/import_merge/importSubRestart.py
+73
-0
tests/pytest/import_merge/importTORestart.py
tests/pytest/import_merge/importTORestart.py
+73
-0
tests/pytest/import_merge/importTPORestart.py
tests/pytest/import_merge/importTPORestart.py
+75
-0
tests/pytest/import_merge/importTRestart.py
tests/pytest/import_merge/importTRestart.py
+72
-0
tests/pytest/import_merge/importTail.py
tests/pytest/import_merge/importTail.py
+68
-0
tests/pytest/import_merge/importTailOverlap.py
tests/pytest/import_merge/importTailOverlap.py
+70
-0
tests/pytest/import_merge/importTailPartOverlap.py
tests/pytest/import_merge/importTailPartOverlap.py
+70
-0
tests/pytest/import_merge/importToCommit.py
tests/pytest/import_merge/importToCommit.py
+81
-0
tests/pytest/smoketest.sh
tests/pytest/smoketest.sh
+55
-0
tests/test-all.sh
tests/test-all.sh
+6
-1
未找到文件。
.travis.yml
浏览文件 @
fd76b5f7
...
...
@@ -46,10 +46,10 @@ matrix:
pip3 install --user ${TRAVIS_BUILD_DIR}/src/connector/python/linux/python3/
cd ${TRAVIS_BUILD_DIR}/tests
./test-all.sh || travis_terminate $?
./test-all.sh
$TRAVIS_EVENT_TYPE
|| travis_terminate $?
cd ${TRAVIS_BUILD_DIR}/tests/pytest
./s
impl
etest.sh -g 2>&1 | tee mem-error-out.txt
./s
mok
etest.sh -g 2>&1 | tee mem-error-out.txt
sleep 1
# Color setting
...
...
@@ -86,13 +86,12 @@ matrix:
addons
:
coverity_scan
:
# GitHub project metadata
# ** specific to your project **
project
:
name
:
TDengine
version
:
2.x
description
:
taosdata/
TDengine
description
:
TDengine
# Where email notification of build analysis results will be sent
notification_email
:
sdsang@taosdata.com
...
...
tests/pytest/fulltest.sh
0 → 100755
浏览文件 @
fd76b5f7
#!/bin/bash
python3 ./test.py
$1
-f
insert/basic.py
python3 ./test.py
$1
-f
insert/int.py
python3 ./test.py
$1
-f
insert/float.py
python3 ./test.py
$1
-f
insert/bigint.py
python3 ./test.py
$1
-f
insert/bool.py
python3 ./test.py
$1
-f
insert/double.py
python3 ./test.py
$1
-f
insert/smallint.py
python3 ./test.py
$1
-f
insert/tinyint.py
python3 ./test.py
$1
-f
import_merge/importBlock1HO.py
python3 ./test.py
$1
-f
import_merge/importBlock1HPO.py
python3 ./test.py
$1
-f
import_merge/importBlock1H.py
python3 ./test.py
$1
-f
import_merge/importBlock1S.py
python3 ./test.py
$1
-f
import_merge/importBlock1Sub.py
python3 ./test.py
$1
-f
import_merge/importBlock1TO.py
python3 ./test.py
$1
-f
import_merge/importBlock1TPO.py
python3 ./test.py
$1
-f
import_merge/importBlock1T.py
python3 ./test.py
$1
-f
import_merge/importBlock2HO.py
python3 ./test.py
$1
-f
import_merge/importBlock2HPO.py
python3 ./test.py
$1
-f
import_merge/importBlock2H.py
python3 ./test.py
$1
-f
import_merge/importBlock2S.py
python3 ./test.py
$1
-f
import_merge/importBlock2Sub.py
python3 ./test.py
$1
-f
import_merge/importBlock2TO.py
python3 ./test.py
$1
-f
import_merge/importBlock2TPO.py
python3 ./test.py
$1
-f
import_merge/importBlock2T.py
python3 ./test.py
$1
-f
import_merge/importBlockbetween.py
python3 ./test.py
$1
-f
import_merge/importCacheFileHO.py
python3 ./test.py
$1
-f
import_merge/importCacheFileHPO.py
python3 ./test.py
$1
-f
import_merge/importCacheFileH.py
python3 ./test.py
$1
-f
import_merge/importCacheFileS.py
python3 ./test.py
$1
-f
import_merge/importCacheFileSub.py
python3 ./test.py
$1
-f
import_merge/importCacheFileTO.py
python3 ./test.py
$1
-f
import_merge/importCacheFileTPO.py
python3 ./test.py
$1
-f
import_merge/importCacheFileT.py
python3 ./test.py
$1
-f
import_merge/importDataH2.py
python3 ./test.py
$1
-f
import_merge/importDataHO2.py
python3 ./test.py
$1
-f
import_merge/importDataHO.py
python3 ./test.py
$1
-f
import_merge/importDataHPO.py
python3 ./test.py
$1
-f
import_merge/importDataLastHO.py
python3 ./test.py
$1
-f
import_merge/importDataLastHPO.py
python3 ./test.py
$1
-f
import_merge/importDataLastH.py
python3 ./test.py
$1
-f
import_merge/importDataLastS.py
python3 ./test.py
$1
-f
import_merge/importDataLastSub.py
python3 ./test.py
$1
-f
import_merge/importDataLastTO.py
python3 ./test.py
$1
-f
import_merge/importDataLastTPO.py
python3 ./test.py
$1
-f
import_merge/importDataLastT.py
python3 ./test.py
$1
-f
import_merge/importDataS.py
python3 ./test.py
$1
-f
import_merge/importDataSub.py
python3 ./test.py
$1
-f
import_merge/importDataTO.py
python3 ./test.py
$1
-f
import_merge/importDataTPO.py
python3 ./test.py
$1
-f
import_merge/importDataT.py
python3 ./test.py
$1
-f
import_merge/importHeadOverlap.py
python3 ./test.py
$1
-f
import_merge/importHeadPartOverlap.py
python3 ./test.py
$1
-f
import_merge/importHead.py
python3 ./test.py
$1
-f
import_merge/importHORestart.py
python3 ./test.py
$1
-f
import_merge/importHPORestart.py
python3 ./test.py
$1
-f
import_merge/importHRestart.py
python3 ./test.py
$1
-f
import_merge/importLastHO.py
python3 ./test.py
$1
-f
import_merge/importLastHPO.py
python3 ./test.py
$1
-f
import_merge/importLastH.py
python3 ./test.py
$1
-f
import_merge/importLastS.py
python3 ./test.py
$1
-f
import_merge/importLastSub.py
python3 ./test.py
$1
-f
import_merge/importLastTO.py
python3 ./test.py
$1
-f
import_merge/importLastTPO.py
python3 ./test.py
$1
-f
import_merge/importLastT.py
python3 ./test.py
$1
-f
import_merge/importSpan.py
python3 ./test.py
$1
-f
import_merge/importSRestart.py
python3 ./test.py
$1
-f
import_merge/importSubRestart.py
python3 ./test.py
$1
-f
import_merge/importTailOverlap.py
python3 ./test.py
$1
-f
import_merge/importTailPartOverlap.py
python3 ./test.py
$1
-f
import_merge/importTail.py
python3 ./test.py
$1
-f
import_merge/importToCommit.py
python3 ./test.py
$1
-f
import_merge/importTORestart.py
python3 ./test.py
$1
-f
import_merge/importTPORestart.py
python3 ./test.py
$1
-f
import_merge/importTRestart.py
tests/pytest/import_merge/__init__.py
0 → 100644
浏览文件 @
fd76b5f7
tests/pytest/import_merge/importBlock1H.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db cache 512'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"one block can import 38 records"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 38 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
39
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
38
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 1 data before"
)
startTime
=
self
.
startTime
-
1
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
,
rid
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
39
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importBlock1HO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db cache 512'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"one block can import 38 records"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 38 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
39
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
38
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 10 data before with overlap"
)
startTime
=
self
.
startTime
-
5
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
43
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importBlock1HPO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db cache 512'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"one block can import 38 records"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 38 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
for
rid
in
range
(
15
,
43
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
38
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 20 data before with partly overlap"
)
startTime
=
self
.
startTime
-
5
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
21
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
47
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importBlock1S.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db cache 512'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"one block can import 38 records"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 38 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
39
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
38
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 50 data covering existing data"
)
startTime
=
self
.
startTime
-
5
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
51
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
50
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importBlock1Sub.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db cache 512'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"one block can import 38 records"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 38 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
39
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
38
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 10 data totally repetitive"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
38
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importBlock1T.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db cache 512'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"one block can import 38 records"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 38 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
39
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
38
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 1 data after"
)
startTime
=
self
.
startTime
+
38
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
1
,
rid
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
39
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importBlock1TO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db cache 512'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"one block can import 38 records"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 38 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
39
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
38
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 10 data later with overlap"
)
startTime
=
self
.
startTime
+
30
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
40
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importBlock1TPO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db cache 512'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"one block can import 38 records"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 38 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
31
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
for
rid
in
range
(
35
,
43
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
38
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 30 data later with partly overlap"
)
startTime
=
self
.
startTime
+
25
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
31
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
55
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importBlock2H.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db cache 512'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"one block can import 38 records"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 76 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
77
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
76
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 1 data before"
)
startTime
=
self
.
startTime
-
1
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
,
rid
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
77
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importBlock2HO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db cache 512'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"one block can import 38 records"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 76 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
77
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
76
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 10 data before with overlap"
)
startTime
=
self
.
startTime
-
5
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
81
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importBlock2HPO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db cache 512'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"one block can import 38 records"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 76 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
for
rid
in
range
(
15
,
81
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
76
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 20 data before with partly overlap"
)
startTime
=
self
.
startTime
-
5
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
21
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
85
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importBlock2S.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db cache 512'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"one block can import 38 records"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 76 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
77
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
76
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 90 data covering existing data"
)
startTime
=
self
.
startTime
-
5
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
91
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
90
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importBlock2Sub.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db cache 512'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"one block can import 38 records"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 76 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
77
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
76
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 10 data totally repetitive"
)
startTime
=
self
.
startTime
+
10
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
76
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importBlock2T.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db cache 512'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"one block can import 38 records"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 76 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
77
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
76
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 1 data after"
)
startTime
=
self
.
startTime
+
76
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
1
,
rid
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
77
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importBlock2TO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db cache 512'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"one block can import 38 records"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 76 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
77
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
76
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 10 data later with overlap"
)
startTime
=
self
.
startTime
+
70
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
80
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importBlock2TPO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db cache 512'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"one block can import 38 records"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 76 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
61
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
for
rid
in
range
(
65
,
81
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
76
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 30 data later with partly overlap"
)
startTime
=
self
.
startTime
+
55
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
31
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
85
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importBlockbetween.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db cache 512'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"one block can import 38 records"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 76 sequential data with gap between 2 blocks"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
39
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
for
rid
in
range
(
40
,
78
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
76
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import data into the gap between 2 blocks"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
39
,
40
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
77
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importCacheFileH.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 10 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
10
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 10 data again"
)
startTime
=
self
.
startTime
+
10
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
20
)
tdLog
.
info
(
"================= step7"
)
tdLog
.
info
(
"import 1 data before"
)
startTime
=
self
.
startTime
-
1
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
,
rid
))
tdLog
.
info
(
"================= step8"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
21
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importCacheFileHO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 10 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
10
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 10 data again"
)
startTime
=
self
.
startTime
+
10
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
20
)
tdLog
.
info
(
"================= step7"
)
tdLog
.
info
(
"import 10 data before with overlap"
)
startTime
=
self
.
startTime
-
5
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step8"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
25
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importCacheFileHPO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 9 sequential data with gap"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
if
(
rid
==
5
):
continue
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
9
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 9 data again with gap"
)
startTime
=
self
.
startTime
+
10
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
if
(
rid
==
5
):
continue
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
18
)
tdLog
.
info
(
"================= step7"
)
tdLog
.
info
(
"import 20 data before with partly overlap"
)
startTime
=
self
.
startTime
-
3
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
21
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step8"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
23
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importCacheFileS.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 10 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
10
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 10 data again"
)
startTime
=
self
.
startTime
+
10
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
20
)
tdLog
.
info
(
"================= step7"
)
tdLog
.
info
(
"import 30 data covering existing data"
)
startTime
=
self
.
startTime
-
5
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
31
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step8"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
30
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importCacheFileSub.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 10 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
10
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 10 data again"
)
startTime
=
self
.
startTime
+
10
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
20
)
tdLog
.
info
(
"================= step7"
)
tdLog
.
info
(
"import 10 data totally repetitive"
)
startTime
=
self
.
startTime
+
5
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step8"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
20
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importCacheFileT.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 10 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
10
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 10 data again"
)
startTime
=
self
.
startTime
+
10
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
20
)
tdLog
.
info
(
"================= step7"
)
tdLog
.
info
(
"import 1 data later"
)
startTime
=
self
.
startTime
+
20
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
1
,
rid
))
tdLog
.
info
(
"================= step8"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
21
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importCacheFileTO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 10 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
10
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 10 data again"
)
startTime
=
self
.
startTime
+
10
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
20
)
tdLog
.
info
(
"================= step7"
)
tdLog
.
info
(
"import 10 data later with overlap"
)
startTime
=
self
.
startTime
+
15
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step8"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
25
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importCacheFileTPO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 9 sequential data with gap"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
if
(
rid
==
7
):
continue
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
9
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 9 data again with gap"
)
startTime
=
self
.
startTime
+
10
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
if
(
rid
==
7
):
continue
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
18
)
tdLog
.
info
(
"================= step7"
)
tdLog
.
info
(
"import 20 data later with partly overlap"
)
startTime
=
self
.
startTime
+
5
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
21
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step8"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
25
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importDataH2.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"More than 10 rows less than %d rows will go to data file"
%
self
.
rows
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import %d sequential data"
%
(
self
.
rows
/
2
))
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
self
.
rows
/
2
+
1
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
self
.
rows
/
2
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 1 data before"
)
startTime
=
self
.
startTime
-
1
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
1
,
1
))
tdLog
.
info
(
"================= step7"
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
query
(
'select * from tb1 order by ts desc'
)
tdSql
.
checkRows
(
self
.
rows
/
2
+
1
)
tdLog
.
info
(
"================= step8"
)
tdLog
.
info
(
"import 10 data in batch before"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
-
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step9"
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
query
(
'select * from tb1 order by ts desc'
)
tdSql
.
checkRows
(
self
.
rows
/
2
+
11
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importDataHO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
self
.
rowsPerTable
=
20
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"More than 10 rows less than %d rows will go to data file"
%
self
.
rows
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import %d sequential data"
%
self
.
rowsPerTable
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
self
.
rowsPerTable
+
1
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select count(*) from tb1'
)
tdSql
.
checkData
(
0
,
0
,
self
.
rowsPerTable
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 6 data before with overlap"
)
startTime
=
self
.
startTime
-
3
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
7
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1 order by ts desc'
)
tdSql
.
checkRows
(
self
.
rowsPerTable
+
3
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importDataHO2.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
self
.
rowsPerTable
=
100
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"More than 10 rows less than %d rows will go to data file"
%
self
.
rows
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import %d sequential data"
%
self
.
rowsPerTable
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
self
.
rowsPerTable
+
1
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select count(*) from tb1'
)
tdSql
.
checkData
(
0
,
0
,
self
.
rowsPerTable
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 6 data before with overlap"
)
startTime
=
self
.
startTime
-
3
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
6
,
0
,
-
1
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1 order by ts desc'
)
tdSql
.
checkRows
(
self
.
rowsPerTable
+
3
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importDataHPO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
self
.
rowsPerTable
=
20
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"More than 10 rows less than %d rows will go to data file"
%
self
.
rows
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import %d sequential data"
%
self
.
rowsPerTable
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
10
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
for
rid
in
range
(
14
,
self
.
rowsPerTable
+
5
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select count(*) from tb1'
)
tdSql
.
checkData
(
0
,
0
,
self
.
rowsPerTable
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 20 data before with partly overlap"
)
startTime
=
self
.
startTime
-
4
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
21
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
self
.
rowsPerTable
+
8
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importDataLastH.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"More than %d rows less than %d rows will go to data and last file"
%
(
self
.
rows
,
10
+
self
.
rows
))
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 205 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
206
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
205
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 1 data before"
)
startTime
=
self
.
startTime
-
1
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
1
,
1
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
206
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importDataLastHO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"More than %d rows less than %d rows will go to data and last file"
%
(
self
.
rows
,
10
+
self
.
rows
))
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 205 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
206
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
205
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 5 data before with overlap"
)
startTime
=
self
.
startTime
-
2
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
6
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
207
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importDataLastHPO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"More than %d rows less than %d rows will go to data and last file"
%
(
self
.
rows
,
10
+
self
.
rows
))
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 205 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
for
rid
in
range
(
14
,
209
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
205
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 20 data before with partly overlap"
)
startTime
=
self
.
startTime
-
2
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
21
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
210
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importDataLastS.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"More than %d rows less than %d rows will go to data and last file"
%
(
self
.
rows
,
10
+
self
.
rows
))
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 205 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
206
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
205
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 250 data covering the existing data"
)
startTime
=
self
.
startTime
-
15
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
251
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
250
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importDataLastSub.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"More than %d rows less than %d rows will go to data and last file"
%
(
self
.
rows
,
10
+
self
.
rows
))
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 205 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
206
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
205
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 10 data totally repetitive"
)
startTime
=
self
.
startTime
+
10
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
205
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importDataLastT.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"More than %d rows less than %d rows will go to data and last file"
%
(
self
.
rows
,
10
+
self
.
rows
))
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 205 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
206
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
205
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 1 data later"
)
startTime
=
self
.
startTime
+
205
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
1
,
1
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
206
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importDataLastTO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"More than %d rows less than %d rows will go to data and last file"
%
(
self
.
rows
,
10
+
self
.
rows
))
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 205 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
206
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
205
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 5 data later with overlap"
)
startTime
=
self
.
startTime
+
203
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
6
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
208
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importDataLastTPO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"More than %d rows less than %d rows will go to data and last file"
%
(
self
.
rows
,
10
+
self
.
rows
))
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 205 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
196
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
for
rid
in
range
(
200
,
210
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
205
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 20 data later with partly overlap"
)
startTime
=
self
.
startTime
+
192
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
21
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
212
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importDataS.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"More than 10 rows less than %d rows will go to data file"
%
self
.
rows
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 20 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
21
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
20
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 30 data covering the existing data"
)
startTime
=
self
.
startTime
-
5
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
31
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
30
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importDataSub.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"More than 10 rows less than %d rows will go to data file"
%
self
.
rows
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import %d sequential data"
%
(
self
.
rows
/
2
))
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
self
.
rows
/
2
+
1
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
self
.
rows
/
2
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 10 data totally repetitive"
)
startTime
=
self
.
startTime
+
10
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
11
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step9"
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
query
(
'select * from tb1 order by ts desc'
)
tdSql
.
checkRows
(
self
.
rows
/
2
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importDataT.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"More than 10 rows less than %d rows will go to data file"
%
self
.
rows
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 20 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
21
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
20
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 1 data later"
)
startTime
=
self
.
startTime
+
20
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
1
,
1
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
21
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importDataTO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"More than 10 rows less than %d rows will go to data file"
%
self
.
rows
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 20 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
21
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
20
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 6 data later with overlap"
)
startTime
=
self
.
startTime
+
18
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
7
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
24
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importDataTPO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"More than 10 rows less than %d rows will go to data file"
%
self
.
rows
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 20 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
18
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
for
rid
in
range
(
22
,
25
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
20
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
5
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 20 data later with partly overlap"
)
startTime
=
self
.
startTime
+
15
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
21
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
35
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importHORestart.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdSql
.
prepare
()
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, i int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 10 sequential data"
)
startTime
=
self
.
startTime
for
rid
in
range
(
1
,
11
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
10
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 5 data before with overlap"
)
startTime
=
self
.
startTime
-
2
for
rid
in
range
(
1
,
11
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
12
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importHPORestart.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdSql
.
prepare
()
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, i int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 8 sequential data with gap"
)
startTime
=
self
.
startTime
for
rid
in
range
(
1
,
4
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
for
rid
in
range
(
6
,
11
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
startTime
+=
1
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
8
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 8 data before with partly overlap"
)
startTime
=
self
.
startTime
-
2
for
rid
in
range
(
1
,
9
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
12
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importHRestart.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdSql
.
prepare
()
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, i int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 10 sequential data"
)
startTime
=
self
.
startTime
for
rid
in
range
(
1
,
11
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
10
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 1 data before"
)
startTime
=
self
.
startTime
-
1
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
,
rid
))
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
11
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importHead.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 10 sequential data"
)
startTime
=
self
.
startTime
for
rid
in
range
(
1
,
11
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
,
rid
))
startTime
+=
1
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
10
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 1 data before"
)
startTime
=
self
.
startTime
-
1
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
,
rid
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
11
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importHeadOverlap.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdSql
.
prepare
()
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 10 sequential data"
)
startTime
=
self
.
startTime
for
rid
in
range
(
1
,
11
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
,
rid
))
startTime
+=
1
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
10
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 5 data before with overlap"
)
startTime
=
self
.
startTime
-
2
for
rid
in
range
(
1
,
11
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
,
rid
))
startTime
+=
1
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
12
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importHeadPartOverlap.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdSql
.
prepare
()
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, i int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 8 sequential data with gap"
)
startTime
=
self
.
startTime
for
rid
in
range
(
1
,
4
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
,
rid
))
startTime
+=
1
startTime
+=
2
for
rid
in
range
(
6
,
11
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
,
rid
))
startTime
+=
1
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
8
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 8 data before with partly overlap"
)
startTime
=
self
.
startTime
-
2
for
rid
in
range
(
1
,
9
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
,
rid
))
startTime
+=
1
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
12
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importLastH.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"less than 10 rows will go to last file"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 5 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
6
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
5
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 1 data before"
)
startTime
=
self
.
startTime
-
1
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
1
,
1
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
6
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importLastHO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"less than 10 rows will go to last file"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 5 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
6
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
5
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 4 data before with overlap"
)
startTime
=
self
.
startTime
-
2
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
5
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
7
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importLastHPO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"less than 10 rows will go to last file"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 6 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
4
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
for
rid
in
range
(
6
,
9
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
6
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 8 data before with partly overlap"
)
startTime
=
self
.
startTime
-
2
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
9
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
10
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importLastS.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"less than 10 rows will go to last file"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 5 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
6
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
5
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 20 data covering existing data"
)
startTime
=
self
.
startTime
-
10
for
rid
in
range
(
1
,
21
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
20
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importLastSub.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"less than 10 rows will go to last file"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 5 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
6
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
5
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 3 data totally repetitive"
)
startTime
=
self
.
startTime
+
1
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
4
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
5
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importLastT.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"less than 10 rows will go to last file"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 5 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
6
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
5
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 1 data later"
)
startTime
=
self
.
startTime
+
5
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
1
,
1
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
6
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importLastTO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"less than 10 rows will go to last file"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 5 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
6
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
5
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 4 data later with overlap"
)
startTime
=
self
.
startTime
+
3
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
5
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
7
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importLastTPO.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
self
.
rows
=
200
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db rows %d'
%
self
.
rows
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"less than 10 rows will go to last file"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 6 sequential data"
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
1
,
4
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
for
rid
in
range
(
6
,
9
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
6
)
tdLog
.
info
(
"================= step4"
)
tdDnodes
.
stop
(
1
)
tdLog
.
sleep
(
5
)
tdDnodes
.
start
(
1
)
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 8 data later with partly overlap"
)
startTime
=
self
.
startTime
+
2
for
rid
in
range
(
1
,
9
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
10
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importSRestart.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, i int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 10 sequential data"
)
startTime
=
self
.
startTime
for
rid
in
range
(
1
,
11
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
10
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 20 data cover existing data"
)
startTime
=
self
.
startTime
-
5
for
rid
in
range
(
1
,
21
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
20
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importSpan.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 10 sequential data"
)
startTime
=
self
.
startTime
for
rid
in
range
(
1
,
11
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
10
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 20 data cover existing data"
)
startTime
=
self
.
startTime
-
5
for
rid
in
range
(
1
,
21
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
20
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importSubRestart.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, i int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 20 sequential data"
)
startTime
=
self
.
startTime
for
rid
in
range
(
1
,
21
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
20
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 10 data totally repetitive"
)
startTime
=
self
.
startTime
+
5
for
rid
in
range
(
1
,
11
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
20
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importTORestart.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, i int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 10 sequential data"
)
startTime
=
self
.
startTime
for
rid
in
range
(
1
,
11
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
10
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 6 data after with overlap"
)
startTime
=
self
.
startTime
+
8
for
rid
in
range
(
1
,
7
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
14
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importTPORestart.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, i int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 8 sequential data with gap"
)
startTime
=
self
.
startTime
for
rid
in
range
(
1
,
6
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
for
rid
in
range
(
8
,
11
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
8
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 8 data after with partly overlap"
)
startTime
=
self
.
startTime
+
3
for
rid
in
range
(
1
,
9
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
11
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importTRestart.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, i int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 10 sequential data"
)
startTime
=
self
.
startTime
for
rid
in
range
(
1
,
11
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
10
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 1 data after"
)
startTime
=
self
.
startTime
+
11
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
,
rid
))
tdLog
.
info
(
"================= step5"
)
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
sleep
(
10
)
tdLog
.
info
(
"================= step6"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
11
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importTail.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 10 sequential data"
)
startTime
=
self
.
startTime
for
rid
in
range
(
1
,
11
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
,
rid
))
startTime
+=
1
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
10
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 1 data after"
)
startTime
+=
1
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
,
rid
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
11
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importTailOverlap.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 10 sequential data"
)
startTime
=
self
.
startTime
for
rid
in
range
(
1
,
11
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
,
rid
))
startTime
+=
1
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
10
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 6 data after with overlap"
)
startTime
=
self
.
startTime
+
8
for
rid
in
range
(
1
,
7
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
,
rid
))
startTime
+=
1
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
14
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importTailPartOverlap.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, speed int)'
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
"import 8 sequential data with gap"
)
startTime
=
self
.
startTime
for
rid
in
range
(
1
,
6
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
for
rid
in
range
(
8
,
11
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdLog
.
info
(
"================= step3"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
8
)
tdLog
.
info
(
"================= step4"
)
tdLog
.
info
(
"import 8 data after with partly overlap"
)
startTime
=
self
.
startTime
+
3
for
rid
in
range
(
1
,
9
):
tdSql
.
execute
(
'import into tb1 values(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdLog
.
info
(
"================= step5"
)
tdSql
.
query
(
'select * from tb1'
)
tdSql
.
checkRows
(
11
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/import_merge/importToCommit.py
0 → 100644
浏览文件 @
fd76b5f7
###################################################################
# 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
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
self
.
ntables
=
1
self
.
startTime
=
1520000010000
tdDnodes
.
stop
(
1
)
tdDnodes
.
deploy
(
1
)
tdDnodes
.
start
(
1
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists db'
)
tdSql
.
execute
(
'create database db cache 512 tables 10'
)
tdSql
.
execute
(
'use db'
)
tdLog
.
info
(
"================= step1"
)
tdLog
.
info
(
"create 1 table"
)
tdSql
.
execute
(
'create table tb1 (ts timestamp, i int)'
)
tdLog
.
info
(
"one block can import 38 records and totally there are 40 blocks"
)
tdLog
.
info
(
"================= step2"
)
tdLog
.
info
(
'insert data until the first commit'
)
dnodesDir
=
tdDnodes
.
getDnodesRootDir
()
dataDir
=
dnodesDir
+
'/dnode1/data/data'
startTime
=
self
.
startTime
rid0
=
1
while
(
True
):
sqlcmd
=
'insert into tb1 values(%ld, %d)'
%
(
startTime
+
rid0
*
2
,
rid0
)
tdSql
.
execute
(
sqlcmd
)
rid0
+=
1
vnodes
=
os
.
listdir
(
dataDir
)
if
(
len
(
vnodes
)
>
0
):
tdLog
.
info
(
"data is committed, stop inserting"
)
break
tdLog
.
info
(
"================= step5"
)
tdLog
.
info
(
"import 1 data before "
)
startTime
=
self
.
startTime
sqlcmd
=
[
'import into tb1 values'
]
for
rid
in
range
(
3
,
4
):
sqlcmd
.
append
(
'(%ld, %d)'
%
(
startTime
+
rid
,
rid
))
tdSql
.
execute
(
" "
.
join
(
sqlcmd
))
tdLog
.
info
(
"================= step6"
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
query
(
'select * from tb1 order by ts desc'
)
tdSql
.
checkRows
(
rid0
-
1
+
1
)
tdLog
.
info
(
"================= step7"
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
query
(
'select count(*) from tb1'
)
tdSql
.
checkData
(
0
,
0
,
rid0
-
1
+
1
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/s
impl
etest.sh
→
tests/pytest/s
mok
etest.sh
浏览文件 @
fd76b5f7
...
...
@@ -23,3 +23,33 @@ sleep 1
python3 ./test.py
$1
-f
insert/tinyint.py
python3 ./test.py
-s
$1
sleep
1
python3 ./test.py
$1
-f
import_merge/importDataLastTO.py
python3 ./test.py
-s
$1
sleep
1
python3 ./test.py
$1
-f
import_merge/importDataLastT.py
python3 ./test.py
-s
$1
sleep
1
python3 ./test.py
$1
-f
import_merge/importDataTO.py
python3 ./test.py
-s
$1
sleep
1
python3 ./test.py
$1
-f
import_merge/importDataT.py
python3 ./test.py
-s
$1
sleep
1
python3 ./test.py
$1
-f
import_merge/importHeadOverlap.py
python3 ./test.py
-s
$1
sleep
1
python3 ./test.py
$1
-f
import_merge/importHeadPartOverlap.py
python3 ./test.py
-s
$1
sleep
1
python3 ./test.py
$1
-f
import_merge/importHORestart.py
python3 ./test.py
-s
$1
sleep
1
python3 ./test.py
$1
-f
import_merge/importHPORestart.py
python3 ./test.py
-s
$1
sleep
1
python3 ./test.py
$1
-f
import_merge/importHRestart.py
python3 ./test.py
-s
$1
sleep
1
python3 ./test.py
$1
-f
import_merge/importLastSub.py
python3 ./test.py
-s
$1
sleep
1
tests/test-all.sh
浏览文件 @
fd76b5f7
...
...
@@ -25,7 +25,12 @@ if [ "$totalFailed" -ne "0" ]; then
fi
cd
../pytest
./simpletest.sh 2>&1 |
tee
pytest-out.txt
if
[
"
$1
"
==
"cron"
]
;
then
./fulltest.sh 2>&1 |
tee
pytest-out.txt
else
./smoketest.sh 2>&1 |
tee
pytest-out.txt
fi
totalPySuccess
=
`
grep
'successfully executed'
pytest-out.txt |
wc
-l
`
if
[
"
$totalPySuccess
"
-gt
"0"
]
;
then
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录