Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zmops-test
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sanshi
zmops-test
Commits
1484287d
Commit
1484287d
authored
Nov 19, 2019
by
sanshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
告警模块提交
parent
c436afb9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
52 deletions
+34
-52
Administrator.xml
.idea/dictionaries/Administrator.xml
+11
-0
Project_Default.xml
.idea/inspectionProfiles/Project_Default.xml
+13
-0
ApiTest.py
WorkApi/ApiTest.py
+0
-47
test_problem_get.py
WorkCase/API/Problem/test_problem_get.py
+10
-5
No files found.
.idea/dictionaries/Administrator.xml
View file @
1484287d
<component
name=
"ProjectDictionaryState"
>
<dictionary
name=
"Administrator"
>
<words>
<w>
applicationids
</w>
<w>
evaltype
</w>
<w>
eventid
</w>
<w>
eventids
</w>
<w>
groupids
</w>
<w>
hostids
</w>
<w>
objectid
</w>
<w>
objectids
</w>
<w>
preservekeys
</w>
<w>
sortfield
</w>
<w>
sortorder
</w>
<w>
zmops
</w>
</words>
</dictionary>
...
...
.idea/inspectionProfiles/Project_Default.xml
0 → 100644
View file @
1484287d
<component
name=
"InspectionProjectProfileManager"
>
<profile
version=
"1.0"
>
<option
name=
"myName"
value=
"Project Default"
/>
<inspection_tool
class=
"PyPep8NamingInspection"
enabled=
"true"
level=
"WEAK WARNING"
enabled_by_default=
"true"
>
<option
name=
"ignoredErrors"
>
<list>
<option
value=
"N803"
/>
</list>
</option>
</inspection_tool>
</profile>
</component>
\ No newline at end of file
WorkApi/ApiTest.py
deleted
100644 → 0
View file @
c436afb9
# -*- coding: utf-8 -*-
# 接口测试
# 作者: 陈磊
# 时间: 2019-10-21
from
WorkApi.HostGroup.hostGroup_get
import
Get
from
WorkApi.HostGroup.hostGroup_create
import
Create
from
WorkApi.HostGroup.hostGroup_delete
import
Delete
from
WorkApi.HostGroup.hostGroup_update
import
Update
from
WorkUtils.UtilsResponse
import
UtilsResponse
import
time
# 域名
host
=
"http://10.0.0.12:8080"
# 查询主机
# api = Get(host=host)
# api.searchWildcardsEnabled = "true"
# api.searchByAny = "true"
# api.monitoredHosts = "true"
# api.withItems = "true"
#
# api.output_add("extend")
# api.filter_name_add("Zabbix servers")
# api.filter_name_add("Linux servers")
# api.search_name_add("*emp*")
# 创建主机
# api = Create(host=host)
# api.name = "三石测试主机2"
# api.groupid = 1
# api.flags = 0
# api.internal = 1
# 删除主机
# api = Delete(host=host)
# api.groupids_add(groupids=34)
# 更新主机
api
=
Update
(
host
=
host
)
api
.
groupid
=
33
api
.
name
=
"三石测试主机1-1"
api
.
get_response
()
WorkCase/API/Problem/test_problem_get.py
View file @
1484287d
...
...
@@ -132,8 +132,6 @@ class TestProblemGet(object):
assert
y
[
"name"
]
in
UtilsResponse
()
.
get_values_from_sql
(
_sql
=
sql
,
key
=
"name"
)
assert
y
[
"severity"
]
in
UtilsResponse
()
.
get_values_from_sql
(
_sql
=
sql
,
key
=
"severity"
)
@allure.title
(
"problem.get:无参数调用"
)
@allure.story
(
"查询告警:无参数调用"
)
@allure.severity
(
"blocker"
)
...
...
@@ -153,10 +151,9 @@ class TestProblemGet(object):
response
=
self
.
problem_get
(
output
=
[
"name"
])
self
.
check_code
(
response
=
response
,
code
=
0
)
@allure.title
(
"
triggerprototype
.get:output=[source, object, objectid, name, severity]"
)
@allure.title
(
"
problem
.get:output=[source, object, objectid, name, severity]"
)
@allure.story
(
"查询触发器原型:output=[source, object, objectid, name, severity]"
)
def
test_case_05
(
self
):
response
=
self
.
problem_get
(
output
=
[
"source"
,
"object"
,
"objectid"
,
"name"
,
"severity"
])
self
.
check_code
(
response
=
response
,
code
=
0
)
self
.
check_sql
(
response
=
response
)
...
...
@@ -182,6 +179,13 @@ class TestProblemGet(object):
self
.
check_code
(
response
=
response
,
code
=
0
)
self
.
check_sortfield
(
response
=
response
,
possible
=
"DESC"
)
@allure.title
(
"problem.get:output=[source, object, objectid, name, severity]"
)
@allure.story
(
"查询触发器原型:output=[source, object, objectid, name, severity]"
)
def
test_case_10
(
self
):
response
=
self
.
problem_get
(
hostids
=
[
10272
,
10275
],
output
=
[
"source"
,
"object"
,
"objectid"
,
"name"
,
"severity"
])
self
.
check_code
(
response
=
response
,
code
=
0
)
self
.
check_sql
(
response
=
response
)
if
__name__
==
"__main__"
:
from
WorkUtils.UtilsPyTest
import
UtilsPyTest
...
...
@@ -194,6 +198,7 @@ if __name__ == "__main__":
case
=
UtilsCmd
()
.
pytest_cmd
()
r
=
UtilsPyTest
(
case
=
case
,
case_info
=
case_info
)
r
.
run_main
()
# a = TestProblemGet()
# a.setup_class()
# a.test_case_
05
()
# a.test_case_
10
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment