Commit 7bd54d7b by sanshi

设备

parent 81126a70
...@@ -181,7 +181,7 @@ class TestDeviceDelete(object): ...@@ -181,7 +181,7 @@ class TestDeviceDelete(object):
def case_create(self, num): def case_create(self, num):
name = self.base_name + num name = self.base_name + num
response = self.device_create(token=self.token, hostName=name, hostType=self.base_type_agent, iplist=self.base_ip, monitorInterface=self.base_port, response = self.device_create(token=self.token, hostName=name, hostType=self.base_type_agent, iplist=self.base_ip, monitorInterface=self.base_port,
monitorType=1, manageLevel=1, parentHost="parentHost", businessIds=self.base_business_id_1 + "," + self.base_business_id_2, monitorType=1, manageLevel=1, parentHost=1, businessIds=self.base_business_id_1 + "," + self.base_business_id_2,
opsPerson=11, snmpCommunity="snmpCommunity", opsPerson=11, snmpCommunity="snmpCommunity",
ipmiAuthtype=1, ipmiPrivilege=1, ipmiUsername="ipmiUsername", ipmiPassword="ipmiPassword", ipmiAuthtype=1, ipmiPrivilege=1, ipmiUsername="ipmiUsername", ipmiPassword="ipmiPassword",
factoryId=1, model="model", version="version", serialnumber="serialnumber", description="description", factoryId=1, model="model", version="version", serialnumber="serialnumber", description="description",
...@@ -253,11 +253,11 @@ if __name__ == "__main__": ...@@ -253,11 +253,11 @@ if __name__ == "__main__":
import os import os
# 执行自动化测试用例 # 执行自动化测试用例
# case_info = os.path.split(__file__) case_info = os.path.split(__file__)
# case = UtilsCmd().pytest_cmd() case = UtilsCmd().pytest_cmd()
# r = UtilsPyTest(case=case, case_info=case_info) r = UtilsPyTest(case=case, case_info=case_info)
# r.run_main() r.run_main()
a = TestDeviceDelete() # a = TestDeviceDelete()
a.setup_class() # a.setup_class()
a.test_case_05() # a.test_case_05()
...@@ -166,7 +166,7 @@ class TestDeviceGet(object): ...@@ -166,7 +166,7 @@ class TestDeviceGet(object):
self.name = self.base_name + num self.name = self.base_name + num
response = self.device_create(token=self.token, hostName=self.name, hostType=self.base_type_agent, response = self.device_create(token=self.token, hostName=self.name, hostType=self.base_type_agent,
iplist=self.base_ip, monitorInterface=self.base_port, iplist=self.base_ip, monitorInterface=self.base_port,
monitorType=1, manageLevel=1, parentHost="parentHost", monitorType=1, manageLevel=1, parentHost=1,
businessIds=self.base_business_id_1 + "," + self.base_business_id_2, businessIds=self.base_business_id_1 + "," + self.base_business_id_2,
businessTree="businessTree", opsPerson=11, snmpCommunity="snmpCommunity", businessTree="businessTree", opsPerson=11, snmpCommunity="snmpCommunity",
ipmiAuthtype=1, ipmiPrivilege=1, ipmiUsername="ipmiUsername", ipmiPassword="ipmiPassword", ipmiAuthtype=1, ipmiPrivilege=1, ipmiUsername="ipmiUsername", ipmiPassword="ipmiPassword",
...@@ -312,6 +312,13 @@ class TestDeviceGet(object): ...@@ -312,6 +312,13 @@ class TestDeviceGet(object):
self.check_code(response=response, code=0) self.check_code(response=response, code=0)
self.check_data(response=response, _key="manageIp", _value=self.base_ip) self.check_data(response=response, _key="manageIp", _value=self.base_ip)
@allure.title("device.get:menuId查询")
@allure.story("查询资产:menuId查询")
def test_case_14(self):
self.get_base_token()
response = self.device_get(token=self.token, menuId=1)
self.check_code(response=response, code=0)
if __name__ == "__main__": if __name__ == "__main__":
from WorkUtils.UtilsPyTest import UtilsPyTest from WorkUtils.UtilsPyTest import UtilsPyTest
...@@ -327,4 +334,4 @@ if __name__ == "__main__": ...@@ -327,4 +334,4 @@ if __name__ == "__main__":
# a = TestDeviceGet() # a = TestDeviceGet()
# a.setup_class() # a.setup_class()
# a.test_case_06() # a.test_case_14()
...@@ -38,7 +38,8 @@ class CaseBase: ...@@ -38,7 +38,8 @@ class CaseBase:
"db_port": 3306, "db_port": 3306,
"db_user": "root", "db_user": "root",
"db_pw": "123456", "db_pw": "123456",
"db_base": "argus" "db_base": "argus",
"db_base_zabbix": "zabbix"
} }
self.status = { self.status = {
......
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