Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
42ad07c0
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
42ad07c0
编写于
5月 15, 2023
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add test cases
上级
b1ead824
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
102 addition
and
0 deletion
+102
-0
tests/system-test/99-TDcase/TS-3404.py
tests/system-test/99-TDcase/TS-3404.py
+102
-0
未找到文件。
tests/system-test/99-TDcase/TS-3404.py
0 → 100644
浏览文件 @
42ad07c0
import
taos
import
sys
import
time
import
socket
import
os
import
threading
from
util.log
import
*
from
util.sql
import
*
from
util.cases
import
*
from
util.dnodes
import
*
class
TDTestCase
:
hostname
=
socket
.
gethostname
()
def
init
(
self
,
conn
,
logSql
,
replicaVar
=
1
):
self
.
replicaVar
=
int
(
replicaVar
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
#tdSql.init(conn.cursor())
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
# output sql.txt file
def
getBuildPath
(
self
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
(
"taosd"
in
files
or
"taosd.exe"
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
buildPath
=
root
[:
len
(
root
)
-
len
(
"/build/bin"
)]
break
return
buildPath
def
create_tables
(
self
):
tdSql
.
execute
(
f
"CREATE STABLE `stb5` (`ts` TIMESTAMP, `ip_value` FLOAT, `ip_quality` INT) TAGS (`t1` INT)"
)
tdSql
.
execute
(
f
"CREATE TABLE `t_11` USING `stb5` (`t1`) TAGS (1)"
)
def
insert_data
(
self
):
tdLog
.
debug
(
"start to insert data ............"
)
tdSql
.
execute
(
f
"INSERT INTO `t_11` VALUES ('2023-05-10 09:30:47.722', 10.30000, 100)"
)
tdSql
.
execute
(
f
"INSERT INTO `t_11` VALUES ('2023-05-10 09:30:56.383', 12.30000, 100)"
)
tdSql
.
execute
(
f
"INSERT INTO `t_11` VALUES ('2023-05-10 09:48:55.778', 13.30000, 100)"
)
tdSql
.
execute
(
f
"INSERT INTO `t_11` VALUES ('2023-05-10 09:51:50.821', 9.30000, 100)"
)
tdSql
.
execute
(
f
"INSERT INTO `t_11` VALUES ('2023-05-10 09:58:07.162', 9.30000, 100)"
)
tdSql
.
execute
(
f
"INSERT INTO `t_11` VALUES ('2023-05-10 13:41:16.075', 9.30000, 100)"
)
tdSql
.
execute
(
f
"INSERT INTO `t_11` VALUES ('2023-05-13 14:12:58.318', 21.00000, 100)"
)
tdSql
.
execute
(
f
"INSERT INTO `t_11` VALUES ('2023-05-13 14:13:21.328', 1.10000, 100)"
)
tdSql
.
execute
(
f
"INSERT INTO `t_11` VALUES ('2023-05-13 14:35:24.258', 1.30000, 100)"
)
tdSql
.
execute
(
f
"INSERT INTO `t_11` VALUES ('2023-05-13 16:56:49.033', 1.80000, 100)"
)
tdLog
.
debug
(
"insert data ............ [OK]"
)
return
def
run
(
self
):
tdSql
.
prepare
()
self
.
create_tables
()
self
.
insert_data
()
tdLog
.
printNoPrefix
(
"======== test TS-3404"
)
tdSql
.
query
(
f
"select _irowts, interp(ip_value) from t_11 range('2023-05-13 14:00:00', '2023-05-13 15:00:00') every(300s) fill(linear);"
)
tdSql
.
checkRows
(
13
)
tdSql
.
checkData
(
0
,
0
,
'2023-05-13 14:00:00.000'
)
tdSql
.
checkData
(
1
,
0
,
'2023-05-13 14:05:00.000'
)
tdSql
.
checkData
(
2
,
0
,
'2023-05-13 14:10:00.000'
)
tdSql
.
checkData
(
3
,
0
,
'2023-05-13 14:15:00.000'
)
tdSql
.
checkData
(
4
,
0
,
'2023-05-13 14:20:00.000'
)
tdSql
.
checkData
(
5
,
0
,
'2023-05-13 14:25:00.000'
)
tdSql
.
checkData
(
6
,
0
,
'2023-05-13 14:30:00.000'
)
tdSql
.
checkData
(
7
,
0
,
'2023-05-13 14:35:00.000'
)
tdSql
.
checkData
(
8
,
0
,
'2023-05-13 14:40:00.000'
)
tdSql
.
checkData
(
9
,
0
,
'2023-05-13 14:45:00.000'
)
tdSql
.
checkData
(
10
,
0
,
'2023-05-13 14:50:00.000'
)
tdSql
.
checkData
(
11
,
0
,
'2023-05-13 14:55:00.000'
)
tdSql
.
checkData
(
12
,
0
,
'2023-05-13 15:00:00.000'
)
tdSql
.
checkData
(
0
,
1
,
20.96512
)
tdSql
.
checkData
(
1
,
1
,
20.97857
)
tdSql
.
checkData
(
2
,
1
,
20.99201
)
tdSql
.
checkData
(
3
,
1
,
1.114917
)
tdSql
.
checkData
(
4
,
1
,
1.160271
)
tdSql
.
checkData
(
5
,
1
,
1.205625
)
tdSql
.
checkData
(
6
,
1
,
1.250978
)
tdSql
.
checkData
(
7
,
1
,
1.296333
)
tdSql
.
checkData
(
8
,
1
,
1.316249
)
tdSql
.
checkData
(
9
,
1
,
1.333927
)
tdSql
.
checkData
(
10
,
1
,
1.351607
)
tdSql
.
checkData
(
11
,
1
,
1.369285
)
tdSql
.
checkData
(
12
,
1
,
1.386964
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录