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
7d69aeb0
Commit
7d69aeb0
authored
Dec 02, 2019
by
sanshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加snmp模板
parent
2bea3507
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
2 deletions
+27
-2
test_host_create.py
WorkCase/API/Host/test_host_create.py
+27
-2
No files found.
WorkCase/API/Host/test_host_create.py
View file @
7d69aeb0
...
...
@@ -204,8 +204,8 @@ class TestHostCreate(object):
response
=
self
.
host_create
(
host
=
host
,
description
=
description
,
groupids
=
[
101
],
interfaces
=
[
interfaces
],
status
=
0
)
self
.
check_code
(
response
=
response
,
code
=
100
)
@allure.title
(
"host.create:模板创建"
)
@allure.story
(
"创建主机:模板创建"
)
@allure.title
(
"host.create:模板创建
agent
"
)
@allure.story
(
"创建主机:模板创建
agent
"
)
def
test_case_04
(
self
):
templateid
=
10001
...
...
@@ -229,6 +229,31 @@ class TestHostCreate(object):
hostid
=
UtilsResponse
()
.
get_result
(
response
=
response
)[
"hostids"
][
0
]
self
.
check_host
(
hostid
=
hostid
,
templateid
=
templateid
)
@allure.title
(
"host.create:模板创建 snmp"
)
@allure.story
(
"创建主机:模板创建 snmp"
)
def
test_case_05
(
self
):
templateid
=
10186
host
=
self
.
base_name
+
"05"
description
=
self
.
base_description
+
"05"
interfaces
=
{
"type"
:
2
,
"main"
:
1
,
"useip"
:
1
,
"ip"
:
self
.
base_ip
,
"dns"
:
""
,
"port"
:
100
,
"bulk"
:
1
}
response
=
self
.
host_create
(
host
=
host
,
description
=
description
,
groupids
=
[
101
],
interfaces
=
[
interfaces
],
status
=
0
,
templateids
=
[
templateid
],
macros
=
[{
"macro"
:
"{$SNMP_COMMUNITY}"
,
"value"
:
"public"
}])
self
.
check_code
(
response
=
response
,
code
=
0
)
hostid
=
UtilsResponse
()
.
get_result
(
response
=
response
)[
"hostids"
][
0
]
self
.
check_host
(
hostid
=
hostid
,
templateid
=
templateid
)
@allure.step
(
"校验创建host的相关数据"
)
def
check_host
(
self
,
hostid
,
templateid
):
self
.
log
.
debug
(
"根据templateid=
%
s, 获取模板监控项IDs"
%
templateid
)
...
...
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