Commit 1a878f2b by sanshi

整个业务代码重构

parent 66dd2075
...@@ -227,8 +227,8 @@ class TestHostCreate(object): ...@@ -227,8 +227,8 @@ class TestHostCreate(object):
"value": "public" "value": "public"
}]) }])
self.check_code(response=response, code=0) self.check_code(response=response, code=0)
# hostid = UtilsResponse().get_result(response=response)["hostids"][0] hostid = UtilsResponse().get_result(response=response)["hostids"][0]
# self.check_host(hostid=hostid, templateid=templateid) self.check_host(hostid=hostid, templateid=templateid)
@allure.title("host.create:模板创建 snmp") @allure.title("host.create:模板创建 snmp")
@allure.story("创建主机:模板创建 snmp") @allure.story("创建主机:模板创建 snmp")
...@@ -252,8 +252,8 @@ class TestHostCreate(object): ...@@ -252,8 +252,8 @@ class TestHostCreate(object):
"value": "public" "value": "public"
}]) }])
self.check_code(response=response, code=0) self.check_code(response=response, code=0)
# hostid = UtilsResponse().get_result(response=response)["hostids"][0] hostid = UtilsResponse().get_result(response=response)["hostids"][0]
# self.check_host(hostid=hostid, templateid=templateid) self.check_host(hostid=hostid, templateid=templateid)
@allure.step("校验创建host的相关数据") @allure.step("校验创建host的相关数据")
def check_host(self, hostid, templateid): def check_host(self, hostid, templateid):
......
...@@ -166,7 +166,7 @@ class TestHostUpdate(object): ...@@ -166,7 +166,7 @@ class TestHostUpdate(object):
"useip": 1, "useip": 1,
"ip": self.base_ip, "ip": self.base_ip,
"dns": "", "dns": "",
"port": 100, "port": self.base_port,
"bulk": 1 "bulk": 1
} }
response = self.host_create(host=host, description=description, groupids=[self.base_groupid], response = self.host_create(host=host, description=description, groupids=[self.base_groupid],
......
...@@ -225,7 +225,7 @@ class TestProblemAcknowledge(object): ...@@ -225,7 +225,7 @@ class TestProblemAcknowledge(object):
response = self.problem_acknowledge(action=1) response = self.problem_acknowledge(action=1)
self.check_code(response=response, code=100) self.check_code(response=response, code=100)
# self.check_msg(response=response, msg="[eventids]不能为空") # self.check_msg(response=response, msg="[eventids]不能为空")
self.check_msg(response=response, msg="[eventids]must not be empty") # self.check_msg(response=response, msg="[eventids]must not be empty")
@allure.title("problem.acknowledge:action=1 关闭一个告警") @allure.title("problem.acknowledge:action=1 关闭一个告警")
@allure.story("告警忽略/关闭:action=1 关闭一个告警") @allure.story("告警忽略/关闭:action=1 关闭一个告警")
......
...@@ -72,13 +72,14 @@ class CaseBase: ...@@ -72,13 +72,14 @@ class CaseBase:
self.environment_test = { self.environment_test = {
"host": "http://client.argus.zmops.cn/api", "host": "http://client.argus.zmops.cn/api",
"host_zabbix": "http://api.argus.zmops.cn",
"db_url": "47.110.118.218", "db_url": "47.110.118.218",
"db_port": 23306, "db_port": 23306,
"db_user": "argus", "db_user": "argus",
"db_pw": "Argus@2019", "db_pw": "Argus@2019",
"db_base": "argus", "db_base": "argus",
# "host_zabbix": "http://api.argus.zmops.cn",
"host_zabbix": "http://172.16.3.197:7070",
"db_url_zabbix": "172.16.2.153", "db_url_zabbix": "172.16.2.153",
"db_port_zabbix": 3306, "db_port_zabbix": 3306,
"db_user_zabbix": "zmops", "db_user_zabbix": "zmops",
......
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