Commit 7d69aeb0 by sanshi

增加snmp模板

parent 2bea3507
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment