Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d8b4240b
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d8b4240b
编写于
6月 07, 2022
作者:
wafwerar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(os): add win32 monitor case
上级
72914955
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
170 addition
and
167 deletion
+170
-167
tests/system-test/0-others/taosdMonitor.py
tests/system-test/0-others/taosdMonitor.py
+167
-165
tests/system-test/fulltest.bat
tests/system-test/fulltest.bat
+2
-2
tests/system-test/test.py
tests/system-test/test.py
+1
-0
未找到文件。
tests/system-test/0-others/taosdMonitor.py
浏览文件 @
d8b4240b
...
@@ -8,6 +8,7 @@ import http.server
...
@@ -8,6 +8,7 @@ import http.server
import
gzip
import
gzip
import
threading
import
threading
import
json
import
json
import
pickle
from
util.log
import
*
from
util.log
import
*
from
util.sql
import
*
from
util.sql
import
*
...
@@ -15,206 +16,203 @@ from util.cases import *
...
@@ -15,206 +16,203 @@ from util.cases import *
from
util.dnodes
import
*
from
util.dnodes
import
*
telemetryPort
=
'6043'
telemetryPort
=
'6043'
serverPort
=
'7080'
hostname
=
socket
.
gethostname
()
class
RequestHandlerImpl
(
http
.
server
.
BaseHTTPRequestHandler
):
hostPort
=
hostname
+
":"
+
serverPort
def
telemetryInfoCheck
(
infoDict
=
''
):
def
telemetryInfoCheck
(
self
,
infoDict
=
''
):
if
"ts"
not
in
infoDict
or
len
(
infoDict
[
"ts"
])
==
0
:
tdLog
.
exit
(
"ts is null!"
)
hostname
=
socket
.
gethostname
()
if
"dnode_id"
not
in
infoDict
or
infoDict
[
"dnode_id"
]
!=
1
:
serverPort
=
7080
tdLog
.
exit
(
"dnode_id is null!"
)
if
"ts"
not
in
infoDict
or
len
(
infoDict
[
"ts"
])
==
0
:
if
"dnode_ep"
not
in
infoDict
:
tdLog
.
exit
(
"ts
is null!"
)
tdLog
.
exit
(
"dnode_ep
is null!"
)
if
"dnode_id"
not
in
infoDict
or
infoDict
[
"dnode_id"
]
!=
1
:
if
"cluster_id"
not
in
infoDict
:
tdLog
.
exit
(
"dnode
_id is null!"
)
tdLog
.
exit
(
"cluster
_id is null!"
)
if
"dnode_ep"
not
in
infoDict
:
if
"protocol"
not
in
infoDict
or
infoDict
[
"protocol"
]
!=
1
:
tdLog
.
exit
(
"dnode_ep
is null!"
)
tdLog
.
exit
(
"protocol
is null!"
)
if
"cluster_id"
not
in
infoDict
:
if
"cluster_info"
not
in
infoDict
:
tdLog
.
exit
(
"cluster_id
is null!"
)
tdLog
.
exit
(
"cluster_info
is null!"
)
if
"protocol"
not
in
infoDict
or
infoDict
[
"protocol"
]
!=
1
:
# cluster_info ====================================
tdLog
.
exit
(
"protocol is null!"
)
if
"cluster_info"
not
in
infoDict
:
if
"first_ep"
not
in
infoDict
[
"cluster_info"
]
or
infoDict
[
"cluster_info"
][
"first_ep"
]
==
None
:
tdLog
.
exit
(
"cluster_info
is null!"
)
tdLog
.
exit
(
"first_ep
is null!"
)
# cluster_info ====================================
if
"first_ep_dnode_id"
not
in
infoDict
[
"cluster_info"
]
or
infoDict
[
"cluster_info"
][
"first_ep_dnode_id"
]
!=
1
:
tdLog
.
exit
(
"first_ep_dnode_id is null!"
)
if
"first_ep"
not
in
infoDict
[
"cluster_info"
]
or
infoDict
[
"cluster_info"
][
"first_ep"
]
==
None
:
if
"version"
not
in
infoDict
[
"cluster_info"
]
or
infoDict
[
"cluster_info"
][
"version"
]
==
None
:
tdLog
.
exit
(
"first_ep is null!"
)
tdLog
.
exit
(
"first_ep_dnode_id is null!"
)
if
"first_ep_dnode_id"
not
in
infoDict
[
"cluster_info"
]
or
infoDict
[
"cluster_info"
][
"first_ep_dnode_id"
]
!=
1
:
if
"master_uptime"
not
in
infoDict
[
"cluster_info"
]
or
infoDict
[
"cluster_info"
][
"master_uptime"
]
==
None
:
tdLog
.
exit
(
"first_ep_dnode_id is null!"
)
tdLog
.
exit
(
"master_uptime is null!"
)
if
"version"
not
in
infoDict
[
"cluster_info"
]
or
infoDict
[
"cluster_info"
][
"version"
]
==
None
:
tdLog
.
exit
(
"first_ep_dnode_id is null!"
)
if
"master_uptime"
not
in
infoDict
[
"cluster_info"
]
or
infoDict
[
"cluster_info"
][
"master_uptime"
]
==
None
:
tdLog
.
exit
(
"master_uptime is null!"
)
if
"monitor_interval"
not
in
infoDict
[
"cluster_info"
]
or
infoDict
[
"cluster_info"
][
"monitor_interval"
]
!=
5
:
if
"monitor_interval"
not
in
infoDict
[
"cluster_info"
]
or
infoDict
[
"cluster_info"
][
"monitor_interval"
]
!=
5
:
tdLog
.
exit
(
"monitor_interval is null!"
)
tdLog
.
exit
(
"monitor_interval is null!"
)
if
"vgroups_total"
not
in
infoDict
[
"cluster_info"
]
or
infoDict
[
"cluster_info"
][
"vgroups_total"
]
<
0
:
if
"vgroups_total"
not
in
infoDict
[
"cluster_info"
]
or
infoDict
[
"cluster_info"
][
"vgroups_total"
]
<
0
:
tdLog
.
exit
(
"vgroups_total is null!"
)
tdLog
.
exit
(
"vgroups_total is null!"
)
if
"vgroups_alive"
not
in
infoDict
[
"cluster_info"
]
or
infoDict
[
"cluster_info"
][
"vgroups_alive"
]
<
0
:
if
"vgroups_alive"
not
in
infoDict
[
"cluster_info"
]
or
infoDict
[
"cluster_info"
][
"vgroups_alive"
]
<
0
:
tdLog
.
exit
(
"vgroups_alive is null!"
)
tdLog
.
exit
(
"vgroups_alive is null!"
)
if
"connections_total"
not
in
infoDict
[
"cluster_info"
]
or
infoDict
[
"cluster_info"
][
"connections_total"
]
<
0
:
if
"connections_total"
not
in
infoDict
[
"cluster_info"
]
or
infoDict
[
"cluster_info"
][
"connections_total"
]
<
0
:
tdLog
.
exit
(
"connections_total is null!"
)
tdLog
.
exit
(
"connections_total is null!"
)
if
"dnodes"
not
in
infoDict
[
"cluster_info"
]
or
infoDict
[
"cluster_info"
][
"dnodes"
]
==
None
:
if
"dnodes"
not
in
infoDict
[
"cluster_info"
]
or
infoDict
[
"cluster_info"
][
"dnodes"
]
==
None
:
tdLog
.
exit
(
"dnodes is null!"
)
tdLog
.
exit
(
"dnodes is null!"
)
dnodes_info
=
{
"dnode_id"
:
1
,
"dnode_ep"
:
f
"
{
hostname
}
:
{
serverPort
}
"
,
"status"
:
"ready"
}
dnodes_info
=
{
"dnode_id"
:
1
,
"dnode_ep"
:
self
.
hostPort
,
"status"
:
"ready"
}
for
k
,
v
in
dnodes_info
.
items
():
for
k
,
v
in
dnodes_info
.
items
():
if
k
not
in
infoDict
[
"cluster_info"
][
"dnodes"
][
0
]
or
v
!=
infoDict
[
"cluster_info"
][
"dnodes"
][
0
][
k
]
:
if
k
not
in
infoDict
[
"cluster_info"
][
"dnodes"
][
0
]
or
v
!=
infoDict
[
"cluster_info"
][
"dnodes"
][
0
][
k
]
:
tdLog
.
exit
(
"dnodes info is null!"
)
tdLog
.
exit
(
"dnodes info is null!"
)
mnodes_info
=
{
"mnode_id"
:
1
,
"mnode_ep"
:
f
"
{
hostname
}
:
{
serverPort
}
"
,
"role"
:
"leader"
}
mnodes_info
=
{
"mnode_id"
:
1
,
"mnode_ep"
:
self
.
hostPort
,
"role"
:
"leader"
}
for
k
,
v
in
mnodes_info
.
items
():
for
k
,
v
in
mnodes_info
.
items
():
if
k
not
in
infoDict
[
"cluster_info"
][
"mnodes"
][
0
]
or
v
!=
infoDict
[
"cluster_info"
][
"mnodes"
][
0
][
k
]
:
if
k
not
in
infoDict
[
"cluster_info"
][
"mnodes"
][
0
]
or
v
!=
infoDict
[
"cluster_info"
][
"mnodes"
][
0
][
k
]
:
tdLog
.
exit
(
"mnodes info is null!"
)
tdLog
.
exit
(
"mnodes info is null!"
)
# vgroup_infos ====================================
# vgroup_infos ====================================
if
"vgroup_infos"
not
in
infoDict
or
infoDict
[
"vgroup_infos"
]
==
None
:
if
"vgroup_infos"
not
in
infoDict
or
infoDict
[
"vgroup_infos"
]
==
None
:
tdLog
.
exit
(
"vgroup_infos is null!"
)
tdLog
.
exit
(
"vgroup_infos is null!"
)
vgroup_infos_nums
=
len
(
infoDict
[
"vgroup_infos"
])
for
index
in
range
(
vgroup_infos_nums
):
if
"vgroup_id"
not
in
infoDict
[
"vgroup_infos"
][
index
]
or
infoDict
[
"vgroup_infos"
][
index
][
"vgroup_id"
]
<
0
:
tdLog
.
exit
(
"vgroup_id is null!"
)
if
"database_name"
not
in
infoDict
[
"vgroup_infos"
][
index
]
or
len
(
infoDict
[
"vgroup_infos"
][
index
][
"database_name"
])
<
0
:
tdLog
.
exit
(
"database_name is null!"
)
if
"tables_num"
not
in
infoDict
[
"vgroup_infos"
][
index
]
or
infoDict
[
"vgroup_infos"
][
index
][
"tables_num"
]
!=
0
:
tdLog
.
exit
(
"tables_num is null!"
)
if
"status"
not
in
infoDict
[
"vgroup_infos"
][
index
]
or
len
(
infoDict
[
"vgroup_infos"
][
index
][
"status"
])
<
0
:
tdLog
.
exit
(
"status is null!"
)
if
"vnodes"
not
in
infoDict
[
"vgroup_infos"
][
index
]
or
infoDict
[
"vgroup_infos"
][
index
][
"vnodes"
]
==
None
:
tdLog
.
exit
(
"vnodes is null!"
)
if
"dnode_id"
not
in
infoDict
[
"vgroup_infos"
][
index
][
"vnodes"
][
0
]
or
infoDict
[
"vgroup_infos"
][
index
][
"vnodes"
][
0
][
"dnode_id"
]
<
0
:
tdLog
.
exit
(
"vnodes is null!"
)
# grant_info ====================================
if
"grant_info"
not
in
infoDict
or
infoDict
[
"grant_info"
]
==
None
:
tdLog
.
exit
(
"grant_info is null!"
)
if
"expire_time"
not
in
infoDict
[
"grant_info"
]
or
not
infoDict
[
"grant_info"
][
"expire_time"
]
>
0
:
tdLog
.
exit
(
"expire_time is null!"
)
if
"timeseries_used"
not
in
infoDict
[
"grant_info"
]
or
not
infoDict
[
"grant_info"
][
"timeseries_used"
]
>
0
:
tdLog
.
exit
(
"timeseries_used is null!"
)
if
"timeseries_total"
not
in
infoDict
[
"grant_info"
]
or
not
infoDict
[
"grant_info"
][
"timeseries_total"
]
>
0
:
tdLog
.
exit
(
"timeseries_total is null!"
)
# dnode_info ====================================
vgroup_infos_nums
=
len
(
infoDict
[
"vgroup_infos"
])
if
"dnode_info"
not
in
infoDict
or
infoDict
[
"dnode_info"
]
==
None
:
for
index
in
range
(
vgroup_infos_nums
):
tdLog
.
exit
(
"dnode_info is null!"
)
if
"vgroup_id"
not
in
infoDict
[
"vgroup_infos"
][
index
]
or
infoDict
[
"vgroup_infos"
][
index
][
"vgroup_id"
]
<
0
:
tdLog
.
exit
(
"vgroup_id is null!"
)
if
"database_name"
not
in
infoDict
[
"vgroup_infos"
][
index
]
or
len
(
infoDict
[
"vgroup_infos"
][
index
][
"database_name"
])
<
0
:
tdLog
.
exit
(
"database_name is null!"
)
if
"tables_num"
not
in
infoDict
[
"vgroup_infos"
][
index
]
or
infoDict
[
"vgroup_infos"
][
index
][
"tables_num"
]
!=
0
:
tdLog
.
exit
(
"tables_num is null!"
)
if
"status"
not
in
infoDict
[
"vgroup_infos"
][
index
]
or
len
(
infoDict
[
"vgroup_infos"
][
index
][
"status"
])
<
0
:
tdLog
.
exit
(
"status is null!"
)
if
"vnodes"
not
in
infoDict
[
"vgroup_infos"
][
index
]
or
infoDict
[
"vgroup_infos"
][
index
][
"vnodes"
]
==
None
:
tdLog
.
exit
(
"vnodes is null!"
)
if
"dnode_id"
not
in
infoDict
[
"vgroup_infos"
][
index
][
"vnodes"
][
0
]
or
infoDict
[
"vgroup_infos"
][
index
][
"vnodes"
][
0
][
"dnode_id"
]
<
0
:
tdLog
.
exit
(
"vnodes is null!"
)
# grant_info ====================================
if
"grant_info"
not
in
infoDict
or
infoDict
[
"grant_info"
]
==
None
:
tdLog
.
exit
(
"grant_info is null!"
)
if
"expire_time"
not
in
infoDict
[
"grant_info"
]
or
not
infoDict
[
"grant_info"
][
"expire_time"
]
>
0
:
tdLog
.
exit
(
"expire_time is null!"
)
if
"timeseries_used"
not
in
infoDict
[
"grant_info"
]
or
not
infoDict
[
"grant_info"
][
"timeseries_used"
]
>
0
:
tdLog
.
exit
(
"timeseries_used is null!"
)
if
"timeseries_total"
not
in
infoDict
[
"grant_info"
]
or
not
infoDict
[
"grant_info"
][
"timeseries_total"
]
>
0
:
tdLog
.
exit
(
"timeseries_total is null!"
)
# dnode_info ====================================
dnode_infos
=
[
'uptime'
,
'cpu_engine'
,
'cpu_system'
,
'cpu_cores'
,
'mem_engine'
,
'mem_system'
,
'mem_total'
,
'disk_engine'
,
if
"dnode_info"
not
in
infoDict
or
infoDict
[
"dnode_info"
]
==
None
:
'disk_used'
,
'disk_total'
,
'net_in'
,
'net_out'
,
'io_read'
,
'io_write'
,
'io_read_disk'
,
'io_write_disk'
,
'req_select'
,
tdLog
.
exit
(
"dnode_info is null!"
)
'req_select_rate'
,
'req_insert'
,
'req_insert_success'
,
'req_insert_rate'
,
'req_insert_batch'
,
'req_insert_batch_success'
,
'req_insert_batch_rate'
,
'errors'
,
'vnodes_num'
,
'masters'
,
'has_mnode'
,
'has_qnode'
,
'has_snode'
,
'has_bnode'
]
for
elem
in
dnode_infos
:
if
elem
not
in
infoDict
[
"dnode_info"
]
or
infoDict
[
"dnode_info"
][
elem
]
<
0
:
tdLog
.
exit
(
f
"
{
elem
}
is null!"
)
# dnode_info ====================================
dnode_infos
=
[
'uptime'
,
'cpu_engine'
,
'cpu_system'
,
'cpu_cores'
,
'mem_engine'
,
'mem_system'
,
'mem_total'
,
'disk_engine'
,
'disk_used'
,
'disk_total'
,
'net_in'
,
'net_out'
,
'io_read'
,
'io_write'
,
'io_read_disk'
,
'io_write_disk'
,
'req_select'
,
'req_select_rate'
,
'req_insert'
,
'req_insert_success'
,
'req_insert_rate'
,
'req_insert_batch'
,
'req_insert_batch_success'
,
'req_insert_batch_rate'
,
'errors'
,
'vnodes_num'
,
'masters'
,
'has_mnode'
,
'has_qnode'
,
'has_snode'
,
'has_bnode'
]
for
elem
in
dnode_infos
:
if
elem
not
in
infoDict
[
"dnode_info"
]
or
infoDict
[
"dnode_info"
][
elem
]
<
0
:
tdLog
.
exit
(
f
"
{
elem
}
is null!"
)
if
"disk_infos"
not
in
infoDict
or
infoDict
[
"disk_infos"
]
==
None
:
# dnode_info ====================================
tdLog
.
exit
(
"disk_infos is null!"
)
# bug for data_dir
if
"datadir"
not
in
infoDict
[
"disk_infos"
]
or
len
(
infoDict
[
"disk_infos"
][
"datadir"
])
<=
0
:
tdLog
.
exit
(
"datadir is null!"
)
if
"name"
not
in
infoDict
[
"disk_infos"
][
"datadir"
][
0
]
or
len
(
infoDict
[
"disk_infos"
][
"datadir"
][
0
][
"name"
])
<=
0
:
if
"disk_infos"
not
in
infoDict
or
infoDict
[
"disk_infos"
]
==
None
:
tdLog
.
exit
(
"name is null!"
)
tdLog
.
exit
(
"disk_infos is null!"
)
# bug for data_dir
if
"datadir"
not
in
infoDict
[
"disk_infos"
]
or
len
(
infoDict
[
"disk_infos"
][
"datadir"
])
<=
0
:
tdLog
.
exit
(
"datadir is null!"
)
if
"level"
not
in
infoDict
[
"disk_infos"
][
"datadir"
][
0
]
or
infoDict
[
"disk_infos"
][
"datadir"
][
0
][
"level"
]
<
0
:
if
"name"
not
in
infoDict
[
"disk_infos"
][
"datadir"
][
0
]
or
len
(
infoDict
[
"disk_infos"
][
"datadir"
][
0
][
"name"
])
<=
0
:
tdLog
.
exit
(
"level
is null!"
)
tdLog
.
exit
(
"name
is null!"
)
if
"avail"
not
in
infoDict
[
"disk_infos"
][
"datadir"
][
0
]
or
infoDict
[
"disk_infos"
][
"datadir"
][
0
][
"avail"
]
<=
0
:
if
"level"
not
in
infoDict
[
"disk_infos"
][
"datadir"
][
0
]
or
infoDict
[
"disk_infos"
][
"datadir"
][
0
][
"level"
]
<
0
:
tdLog
.
exit
(
"avai
l is null!"
)
tdLog
.
exit
(
"leve
l is null!"
)
if
"used"
not
in
infoDict
[
"disk_infos"
][
"datadir"
][
0
]
or
infoDict
[
"disk_infos"
][
"datadir"
][
0
][
"used
"
]
<=
0
:
if
"avail"
not
in
infoDict
[
"disk_infos"
][
"datadir"
][
0
]
or
infoDict
[
"disk_infos"
][
"datadir"
][
0
][
"avail
"
]
<=
0
:
tdLog
.
exit
(
"used
is null!"
)
tdLog
.
exit
(
"avail
is null!"
)
if
"total"
not
in
infoDict
[
"disk_infos"
][
"datadir"
][
0
]
or
infoDict
[
"disk_infos"
][
"datadir"
][
0
][
"total
"
]
<=
0
:
if
"used"
not
in
infoDict
[
"disk_infos"
][
"datadir"
][
0
]
or
infoDict
[
"disk_infos"
][
"datadir"
][
0
][
"used
"
]
<=
0
:
tdLog
.
exit
(
"total
is null!"
)
tdLog
.
exit
(
"used
is null!"
)
if
"total"
not
in
infoDict
[
"disk_infos"
][
"datadir"
][
0
]
or
infoDict
[
"disk_infos"
][
"datadir"
][
0
][
"total"
]
<=
0
:
tdLog
.
exit
(
"total is null!"
)
if
"logdir"
not
in
infoDict
[
"disk_infos"
]
or
infoDict
[
"disk_infos"
][
"logdir"
]
==
None
:
tdLog
.
exit
(
"logdir is null!"
)
if
"name"
not
in
infoDict
[
"disk_infos"
][
"logdir"
]
or
len
(
infoDict
[
"disk_infos"
][
"logdir"
][
"name"
])
<=
0
:
if
"logdir"
not
in
infoDict
[
"disk_infos"
]
or
infoDict
[
"disk_infos"
][
"logdir"
]
==
None
:
tdLog
.
exit
(
"name
is null!"
)
tdLog
.
exit
(
"logdir
is null!"
)
if
"avail"
not
in
infoDict
[
"disk_infos"
][
"logdir"
]
or
infoDict
[
"disk_infos"
][
"logdir"
][
"avail"
]
<=
0
:
if
"name"
not
in
infoDict
[
"disk_infos"
][
"logdir"
]
or
len
(
infoDict
[
"disk_infos"
][
"logdir"
][
"name"
])
<=
0
:
tdLog
.
exit
(
"avail
is null!"
)
tdLog
.
exit
(
"name
is null!"
)
if
"used"
not
in
infoDict
[
"disk_infos"
][
"logdir"
]
or
infoDict
[
"disk_infos"
][
"logdir"
][
"used
"
]
<=
0
:
if
"avail"
not
in
infoDict
[
"disk_infos"
][
"logdir"
]
or
infoDict
[
"disk_infos"
][
"logdir"
][
"avail
"
]
<=
0
:
tdLog
.
exit
(
"used
is null!"
)
tdLog
.
exit
(
"avail
is null!"
)
if
"total"
not
in
infoDict
[
"disk_infos"
][
"logdir"
]
or
infoDict
[
"disk_infos"
][
"logdir"
][
"total
"
]
<=
0
:
if
"used"
not
in
infoDict
[
"disk_infos"
][
"logdir"
]
or
infoDict
[
"disk_infos"
][
"logdir"
][
"used
"
]
<=
0
:
tdLog
.
exit
(
"total
is null!"
)
tdLog
.
exit
(
"used
is null!"
)
if
"total"
not
in
infoDict
[
"disk_infos"
][
"logdir"
]
or
infoDict
[
"disk_infos"
][
"logdir"
][
"total"
]
<=
0
:
tdLog
.
exit
(
"total is null!"
)
if
"tempdir"
not
in
infoDict
[
"disk_infos"
]
or
infoDict
[
"disk_infos"
][
"tempdir"
]
==
None
:
if
"tempdir"
not
in
infoDict
[
"disk_infos"
]
or
infoDict
[
"disk_infos"
][
"tempdir"
]
==
None
:
tdLog
.
exit
(
"tempdir is null!"
)
tdLog
.
exit
(
"tempdir is null!"
)
if
"name"
not
in
infoDict
[
"disk_infos"
][
"tempdir"
]
or
len
(
infoDict
[
"disk_infos"
][
"tempdir"
][
"name"
])
<=
0
:
if
"name"
not
in
infoDict
[
"disk_infos"
][
"tempdir"
]
or
len
(
infoDict
[
"disk_infos"
][
"tempdir"
][
"name"
])
<=
0
:
tdLog
.
exit
(
"name is null!"
)
tdLog
.
exit
(
"name is null!"
)
if
"avail"
not
in
infoDict
[
"disk_infos"
][
"tempdir"
]
or
infoDict
[
"disk_infos"
][
"tempdir"
][
"avail"
]
<=
0
:
if
"avail"
not
in
infoDict
[
"disk_infos"
][
"tempdir"
]
or
infoDict
[
"disk_infos"
][
"tempdir"
][
"avail"
]
<=
0
:
tdLog
.
exit
(
"avail is null!"
)
tdLog
.
exit
(
"avail is null!"
)
if
"used"
not
in
infoDict
[
"disk_infos"
][
"tempdir"
]
or
infoDict
[
"disk_infos"
][
"tempdir"
][
"used"
]
<=
0
:
if
"used"
not
in
infoDict
[
"disk_infos"
][
"tempdir"
]
or
infoDict
[
"disk_infos"
][
"tempdir"
][
"used"
]
<=
0
:
tdLog
.
exit
(
"used is null!"
)
tdLog
.
exit
(
"used is null!"
)
if
"total"
not
in
infoDict
[
"disk_infos"
][
"tempdir"
]
or
infoDict
[
"disk_infos"
][
"tempdir"
][
"total"
]
<=
0
:
if
"total"
not
in
infoDict
[
"disk_infos"
][
"tempdir"
]
or
infoDict
[
"disk_infos"
][
"tempdir"
][
"total"
]
<=
0
:
tdLog
.
exit
(
"total is null!"
)
tdLog
.
exit
(
"total is null!"
)
# log_infos ====================================
# log_infos ====================================
if
"log_infos"
not
in
infoDict
or
infoDict
[
"log_infos"
]
==
None
:
if
"log_infos"
not
in
infoDict
or
infoDict
[
"log_infos"
]
==
None
:
tdLog
.
exit
(
"log_infos is null!"
)
tdLog
.
exit
(
"log_infos is null!"
)
if
"logs"
not
in
infoDict
[
"log_infos"
]
or
len
(
infoDict
[
"log_infos"
][
"logs"
])
!=
10
:
if
"logs"
not
in
infoDict
[
"log_infos"
]
or
len
(
infoDict
[
"log_infos"
][
"logs"
])
!=
10
:
tdLog
.
exit
(
"logs is null!"
)
tdLog
.
exit
(
"logs is null!"
)
if
"ts"
not
in
infoDict
[
"log_infos"
][
"logs"
][
0
]
or
len
(
infoDict
[
"log_infos"
][
"logs"
][
0
][
"ts"
])
<=
10
:
if
"ts"
not
in
infoDict
[
"log_infos"
][
"logs"
][
0
]
or
len
(
infoDict
[
"log_infos"
][
"logs"
][
0
][
"ts"
])
<=
10
:
tdLog
.
exit
(
"ts is null!"
)
tdLog
.
exit
(
"ts is null!"
)
if
"level"
not
in
infoDict
[
"log_infos"
][
"logs"
][
0
]
or
infoDict
[
"log_infos"
][
"logs"
][
0
][
"level"
]
not
in
[
"error"
,
"info"
,
"debug"
,
"trace"
]:
if
"level"
not
in
infoDict
[
"log_infos"
][
"logs"
][
0
]
or
infoDict
[
"log_infos"
][
"logs"
][
0
][
"level"
]
not
in
[
"error"
,
"info"
,
"debug"
,
"trace"
]:
tdLog
.
exit
(
"level is null!"
)
tdLog
.
exit
(
"level is null!"
)
if
"content"
not
in
infoDict
[
"log_infos"
][
"logs"
][
0
]
or
len
(
infoDict
[
"log_infos"
][
"logs"
][
0
][
"ts"
])
<=
1
:
if
"content"
not
in
infoDict
[
"log_infos"
][
"logs"
][
0
]
or
len
(
infoDict
[
"log_infos"
][
"logs"
][
0
][
"ts"
])
<=
1
:
tdLog
.
exit
(
"content is null!"
)
tdLog
.
exit
(
"content is null!"
)
if
"summary"
not
in
infoDict
[
"log_infos"
]
or
len
(
infoDict
[
"log_infos"
][
"summary"
])
!=
4
:
if
"summary"
not
in
infoDict
[
"log_infos"
]
or
len
(
infoDict
[
"log_infos"
][
"summary"
])
!=
4
:
tdLog
.
exit
(
"summary is null!"
)
tdLog
.
exit
(
"summary is null!"
)
if
"total"
not
in
infoDict
[
"log_infos"
][
"summary"
][
0
]
or
infoDict
[
"log_infos"
][
"summary"
][
0
][
"total"
]
<
0
:
if
"total"
not
in
infoDict
[
"log_infos"
][
"summary"
][
0
]
or
infoDict
[
"log_infos"
][
"summary"
][
0
][
"total"
]
<
0
:
tdLog
.
exit
(
"total is null!"
)
tdLog
.
exit
(
"total is null!"
)
if
"level"
not
in
infoDict
[
"log_infos"
][
"summary"
][
0
]
or
infoDict
[
"log_infos"
][
"summary"
][
0
][
"level"
]
not
in
[
"error"
,
"info"
,
"debug"
,
"trace"
]:
if
"level"
not
in
infoDict
[
"log_infos"
][
"summary"
][
0
]
or
infoDict
[
"log_infos"
][
"summary"
][
0
][
"level"
]
not
in
[
"error"
,
"info"
,
"debug"
,
"trace"
]:
tdLog
.
exit
(
"level is null!"
)
tdLog
.
exit
(
"level is null!"
)
class
RequestHandlerImpl
(
http
.
server
.
BaseHTTPRequestHandler
):
def
do_GET
(
self
):
def
do_GET
(
self
):
"""
"""
process GET request
process GET request
...
@@ -245,17 +243,23 @@ class RequestHandlerImpl(http.server.BaseHTTPRequestHandler):
...
@@ -245,17 +243,23 @@ class RequestHandlerImpl(http.server.BaseHTTPRequestHandler):
infoDict
=
json
.
loads
(
plainText
)
infoDict
=
json
.
loads
(
plainText
)
#print("================")
#print("================")
# print(infoDict)
# print(infoDict)
telemetryInfoCheck
(
infoDict
)
self
.
telemetryInfoCheck
(
infoDict
)
# 4. shutdown the server and exit case
# 4. shutdown the server and exit case
assassin
=
threading
.
Thread
(
target
=
httpS
erver
.
shutdown
)
assassin
=
threading
.
Thread
(
target
=
self
.
s
erver
.
shutdown
)
assassin
.
daemon
=
True
assassin
.
daemon
=
True
assassin
.
start
()
assassin
.
start
()
print
(
"==== shutdown http server ===="
)
print
(
"==== shutdown http server ===="
)
class
TDTestCase
:
class
TDTestCase
:
hostname
=
socket
.
gethostname
()
global
hostname
serverPort
=
'7080'
global
serverPort
if
(
platform
.
system
().
lower
()
==
'windows'
and
not
tdDnodes
.
dnodes
[
0
].
remoteIP
==
""
):
try
:
config
=
eval
(
tdDnodes
.
dnodes
[
0
].
remoteIP
)
hostname
=
config
[
"host"
]
except
Exception
:
hostname
=
tdDnodes
.
dnodes
[
0
].
remoteIP
rpcDebugFlagVal
=
'143'
rpcDebugFlagVal
=
'143'
clientCfgDict
=
{
'serverPort'
:
''
,
'firstEp'
:
''
,
'secondEp'
:
''
,
'rpcDebugFlag'
:
'135'
,
'fqdn'
:
''
}
clientCfgDict
=
{
'serverPort'
:
''
,
'firstEp'
:
''
,
'secondEp'
:
''
,
'rpcDebugFlag'
:
'135'
,
'fqdn'
:
''
}
clientCfgDict
[
"serverPort"
]
=
serverPort
clientCfgDict
[
"serverPort"
]
=
serverPort
...
@@ -291,21 +295,19 @@ class TDTestCase:
...
@@ -291,21 +295,19 @@ class TDTestCase:
sql
=
"create database db3 vgroups "
+
vgroups
sql
=
"create database db3 vgroups "
+
vgroups
tdSql
.
query
(
sql
)
tdSql
.
query
(
sql
)
# loop to wait request
# create http server: bing ip/port , and request processor
httpServer
.
serve_forever
()
if
(
platform
.
system
().
lower
()
==
'windows'
and
not
tdDnodes
.
dnodes
[
0
].
remoteIP
==
""
):
RequestHandlerImplStr
=
base64
.
b64encode
(
pickle
.
dumps
(
RequestHandlerImpl
)).
decode
()
cmdStr
=
"import pickle
\n
import http
\n
RequestHandlerImpl=pickle.loads(base64.b64decode(
\"
%s
\"
.encode()))
\n
class NewRequestHandlerImpl(RequestHandlerImpl):
\n
hostPort =
\'
%s
\'\n
http.server.HTTPServer((
\"\"
, %s), NewRequestHandlerImpl).serve_forever()"
%
(
RequestHandlerImplStr
,
hostname
+
":"
+
serverPort
,
telemetryPort
)
tdDnodes
.
dnodes
[
0
].
remoteExec
({},
cmdStr
)
else
:
serverAddress
=
(
""
,
int
(
telemetryPort
))
http
.
server
.
HTTPServer
(
serverAddress
,
RequestHandlerImpl
).
serve_forever
()
def
stop
(
self
):
def
stop
(
self
):
tdSql
.
close
()
tdSql
.
close
()
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
# create http server: bing ip/port , and request processor
serverAddress
=
(
""
,
int
(
telemetryPort
))
httpServer
=
http
.
server
.
HTTPServer
(
serverAddress
,
RequestHandlerImpl
)
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tests/system-test/fulltest.bat
浏览文件 @
d8b4240b
@REM
python3 .\test.py -f 0-others\taosShell.py
python3
.\test.py
-f
0
-others
\taosShell.py
python3
.\test.py
-f
0
-others
\taosShellError.py
python3
.\test.py
-f
0
-others
\taosShellError.py
python3
.\test.py
-f
0
-others
\taosShellNetChk.py
python3
.\test.py
-f
0
-others
\taosShellNetChk.py
python3
.\test.py
-f
0
-others
\telemetry.py
python3
.\test.py
-f
0
-others
\telemetry.py
@REM
python3 .\test.py -f 0-others\taosdMonitor.py
python3
.\test.py
-f
0
-others
\taosdMonitor.py
python3
.\test.py
-f
0
-others
\udfTest.py
python3
.\test.py
-f
0
-others
\udfTest.py
python3
.\test.py
-f
0
-others
\udf_create.py
python3
.\test.py
-f
0
-others
\udf_create.py
python3
.\test.py
-f
0
-others
\udf_restart_taosd.py
python3
.\test.py
-f
0
-others
\udf_restart_taosd.py
...
...
tests/system-test/test.py
浏览文件 @
d8b4240b
...
@@ -114,6 +114,7 @@ if __name__ == "__main__":
...
@@ -114,6 +114,7 @@ if __name__ == "__main__":
if
not
execCmd
==
""
:
if
not
execCmd
==
""
:
tdDnodes
.
init
(
deployPath
)
tdDnodes
.
init
(
deployPath
)
print
(
execCmd
)
exec
(
execCmd
)
exec
(
execCmd
)
quit
()
quit
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录