Commit 17f0b800 by sanshi

资产ips下拉框

parent 9b0930ae
...@@ -42,7 +42,7 @@ class DeviceCreate(object): ...@@ -42,7 +42,7 @@ class DeviceCreate(object):
self.ipmiPrivilege = None self.ipmiPrivilege = None
self.ipmiUsername = None self.ipmiUsername = None
self.ipmiPassword = None self.ipmiPassword = None
self.factory_id = None self.factoryId = None
self.model = None self.model = None
self.version = None self.version = None
self.serialnumber = None self.serialnumber = None
...@@ -72,7 +72,7 @@ class DeviceCreate(object): ...@@ -72,7 +72,7 @@ class DeviceCreate(object):
base.dict_add_key(_key="ipmiPrivilege", value=self.ipmiPrivilege) base.dict_add_key(_key="ipmiPrivilege", value=self.ipmiPrivilege)
base.dict_add_key(_key="ipmiUsername", value=self.ipmiUsername) base.dict_add_key(_key="ipmiUsername", value=self.ipmiUsername)
base.dict_add_key(_key="ipmiPassword", value=self.ipmiPassword) base.dict_add_key(_key="ipmiPassword", value=self.ipmiPassword)
base.dict_add_key(_key="factory_id", value=self.factory_id) base.dict_add_key(_key="factoryId", value=self.factoryId)
base.dict_add_key(_key="model", value=self.model) base.dict_add_key(_key="model", value=self.model)
base.dict_add_key(_key="version", value=self.version) base.dict_add_key(_key="version", value=self.version)
base.dict_add_key(_key="serialnumber", value=self.serialnumber) base.dict_add_key(_key="serialnumber", value=self.serialnumber)
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
from __future__ import division from __future__ import division
import pytest
from WorkCase import CaseBase from WorkCase import CaseBase
from WorkUtils.UtilsLog import UtilsLog from WorkUtils.UtilsLog import UtilsLog
from WorkUtils.UtilsDataBase import UtilsDataBase from WorkUtils.UtilsDataBase import UtilsDataBase
...@@ -89,7 +91,7 @@ class TestDeviceAssetIps(object): ...@@ -89,7 +91,7 @@ class TestDeviceAssetIps(object):
monitorInterface=None, monitorType=None, monitorInterface=None, monitorType=None,
parentHost=None, businessIds=None, opsPerson=None, snmpCommunity=None, ipmiAuthtype=None, parentHost=None, businessIds=None, opsPerson=None, snmpCommunity=None, ipmiAuthtype=None,
ipmiPrivilege=None, ipmiUsername=None, ipmiPassword=None, ipmiPrivilege=None, ipmiUsername=None, ipmiPassword=None,
factory_id=None, model=None, version=None, serialnumber=None, factoryId=None, model=None, version=None, serialnumber=None,
description=None, monitorStatus=None): description=None, monitorStatus=None):
api = DeviceCreate(_host=self.host) api = DeviceCreate(_host=self.host)
api.token = token api.token = token
...@@ -108,7 +110,7 @@ class TestDeviceAssetIps(object): ...@@ -108,7 +110,7 @@ class TestDeviceAssetIps(object):
api.ipmiPrivilege = ipmiPrivilege api.ipmiPrivilege = ipmiPrivilege
api.ipmiUsername = ipmiUsername api.ipmiUsername = ipmiUsername
api.ipmiPassword = ipmiPassword api.ipmiPassword = ipmiPassword
api.factory_id = factory_id api.factoryId = factoryId
api.model = model api.model = model
api.version = version api.version = version
api.serialnumber = serialnumber api.serialnumber = serialnumber
...@@ -147,8 +149,9 @@ class TestDeviceAssetIps(object): ...@@ -147,8 +149,9 @@ class TestDeviceAssetIps(object):
response = self.device_create(token=self.token, hostName=self.name, hostType=self.base_type_agent, iplist=self.base_ip, monitorInterface=self.base_port, response = self.device_create(token=self.token, hostName=self.name, hostType=self.base_type_agent, iplist=self.base_ip, monitorInterface=self.base_port,
monitorType=1, manageLevel=1, parentHost="parentHost", businessIds=1, opsPerson=11, snmpCommunity="snmpCommunity", monitorType=1, manageLevel=1, parentHost="parentHost", businessIds=1, opsPerson=11, snmpCommunity="snmpCommunity",
ipmiAuthtype=1, ipmiPrivilege=1, ipmiUsername="ipmiUsername", ipmiPassword="ipmiPassword", ipmiAuthtype=1, ipmiPrivilege=1, ipmiUsername="ipmiUsername", ipmiPassword="ipmiPassword",
factory_id="factory", model="model", version="version", serialnumber="serialnumber", description="description", factoryId=1, model="model", version="version", serialnumber="serialnumber", description="description",
monitorStatus=1) monitorStatus=1)
self.check_code(response=response, code=0)
self.device_id = UtilsResponse().get_data(response=response) self.device_id = UtilsResponse().get_data(response=response)
@allure.step("断言返回结果") @allure.step("断言返回结果")
...@@ -164,6 +167,7 @@ class TestDeviceAssetIps(object): ...@@ -164,6 +167,7 @@ class TestDeviceAssetIps(object):
@allure.title("device.asset.ips:token未传") @allure.title("device.asset.ips:token未传")
@allure.story("查询资产IPS下拉框:token未传") @allure.story("查询资产IPS下拉框:token未传")
@allure.severity("blocker") @allure.severity("blocker")
@pytest.mark.skip(reason="此接口未加入token验证")
def test_case_01(self): def test_case_01(self):
self.get_base_token() self.get_base_token()
...@@ -174,6 +178,7 @@ class TestDeviceAssetIps(object): ...@@ -174,6 +178,7 @@ class TestDeviceAssetIps(object):
@allure.title("device.asset.ips:token的用户已删除") @allure.title("device.asset.ips:token的用户已删除")
@allure.story("查询资产IPS下拉框:token的用户已删除") @allure.story("查询资产IPS下拉框:token的用户已删除")
@allure.severity("blocker") @allure.severity("blocker")
@pytest.mark.skip(reason="此接口未加入token验证")
def test_case_02(self): def test_case_02(self):
self.get_base_token() self.get_base_token()
self.update_members_del_flag(members_id=self.base_id, value=1) self.update_members_del_flag(members_id=self.base_id, value=1)
...@@ -184,6 +189,7 @@ class TestDeviceAssetIps(object): ...@@ -184,6 +189,7 @@ class TestDeviceAssetIps(object):
@allure.title("device.asset.ips:token的用户已禁用") @allure.title("device.asset.ips:token的用户已禁用")
@allure.story("查询资产IPS下拉框:token的用户已禁用") @allure.story("查询资产IPS下拉框:token的用户已禁用")
@allure.severity("blocker") @allure.severity("blocker")
@pytest.mark.skip(reason="此接口未加入token验证")
def test_case_03(self): def test_case_03(self):
self.get_base_token() self.get_base_token()
self.update_members_status(members_id=self.base_id, value=1) self.update_members_status(members_id=self.base_id, value=1)
...@@ -221,11 +227,11 @@ if __name__ == "__main__": ...@@ -221,11 +227,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 = TestDeviceAssetIps() a = TestDeviceAssetIps()
# a.setup_class() a.setup_class()
# a.test_case_05() a.test_case_05()
...@@ -89,7 +89,7 @@ class TestDeviceCreate(object): ...@@ -89,7 +89,7 @@ class TestDeviceCreate(object):
monitorInterface=None, monitorType=None, monitorInterface=None, monitorType=None,
parentHost=None, businessIds=None, opsPerson=None, snmpCommunity=None, ipmiAuthtype=None, parentHost=None, businessIds=None, opsPerson=None, snmpCommunity=None, ipmiAuthtype=None,
ipmiPrivilege=None, ipmiUsername=None, ipmiPassword=None, ipmiPrivilege=None, ipmiUsername=None, ipmiPassword=None,
factory=None, model=None, version=None, serialnumber=None, factoryId=None, model=None, version=None, serialnumber=None,
description=None, monitorStatus=None): description=None, monitorStatus=None):
api = DeviceCreate(_host=self.host) api = DeviceCreate(_host=self.host)
api.token = token api.token = token
...@@ -108,7 +108,7 @@ class TestDeviceCreate(object): ...@@ -108,7 +108,7 @@ class TestDeviceCreate(object):
api.ipmiPrivilege = ipmiPrivilege api.ipmiPrivilege = ipmiPrivilege
api.ipmiUsername = ipmiUsername api.ipmiUsername = ipmiUsername
api.ipmiPassword = ipmiPassword api.ipmiPassword = ipmiPassword
api.factory = factory api.factoryId = factoryId
api.model = model api.model = model
api.version = version api.version = version
api.serialnumber = serialnumber api.serialnumber = serialnumber
...@@ -135,7 +135,7 @@ class TestDeviceCreate(object): ...@@ -135,7 +135,7 @@ class TestDeviceCreate(object):
@allure.step("校验查询结果") @allure.step("校验查询结果")
def check_select(self, response, name, manage_ip, manage_level, host_type, def check_select(self, response, name, manage_ip, manage_level, host_type,
monitor_status, iplist, dns, monitor_interface, business_ids, ops_person, factory, monitor_status, iplist, dns, monitor_interface, business_ids, ops_person, factory_id,
model, version, serialnumber, description, snmp_community, ipmi_authtype, ipmi_privilege, model, version, serialnumber, description, snmp_community, ipmi_authtype, ipmi_privilege,
ipmi_username, ipmi_password): ipmi_username, ipmi_password):
data = UtilsResponse().get_data(response=response) data = UtilsResponse().get_data(response=response)
...@@ -155,7 +155,7 @@ class TestDeviceCreate(object): ...@@ -155,7 +155,7 @@ class TestDeviceCreate(object):
assert int(y.business_ids) == business_ids assert int(y.business_ids) == business_ids
# assert y.port == port # assert y.port == port
assert y.ops_person == ops_person assert y.ops_person == ops_person
assert y.factory == factory assert y.factory_id == factory_id
assert y.model == model assert y.model == model
assert y.version == version assert y.version == version
assert y.serialnumber == serialnumber assert y.serialnumber == serialnumber
...@@ -260,13 +260,13 @@ class TestDeviceCreate(object): ...@@ -260,13 +260,13 @@ class TestDeviceCreate(object):
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=1, opsPerson=11, snmpCommunity="snmpCommunity", monitorType=1, manageLevel=1, parentHost="parentHost", businessIds=1, opsPerson=11, snmpCommunity="snmpCommunity",
ipmiAuthtype=1, ipmiPrivilege=1, ipmiUsername="ipmiUsername", ipmiPassword="ipmiPassword", ipmiAuthtype=1, ipmiPrivilege=1, ipmiUsername="ipmiUsername", ipmiPassword="ipmiPassword",
factory="factory", model="model", version="version", serialnumber="serialnumber", description="description", factoryId=1, model="model", version="version", serialnumber="serialnumber", description="description",
monitorStatus=1) monitorStatus=1)
self.check_code(response=response, code=0) self.check_code(response=response, code=0)
self.check_select(response=response, name=name, manage_ip=self.base_ip, manage_level=1, host_type=self.base_type_agent, monitor_status=1, self.check_select(response=response, name=name, manage_ip=self.base_ip, manage_level=1, host_type=self.base_type_agent, monitor_status=1,
iplist=self.base_ip, dns=None, monitor_interface=self.base_port, business_ids=1, ops_person=11, snmp_community="snmpCommunity", iplist=self.base_ip, dns=None, monitor_interface=self.base_port, business_ids=1, ops_person=11, snmp_community="snmpCommunity",
ipmi_authtype=1, ipmi_privilege=1, ipmi_username="ipmiUsername", ipmi_password="ipmiPassword", ipmi_authtype=1, ipmi_privilege=1, ipmi_username="ipmiUsername", ipmi_password="ipmiPassword",
factory="factory", model="model", version="version", serialnumber="serialnumber", description="description",) factory_id=1, model="model", version="version", serialnumber="serialnumber", description="description")
if __name__ == "__main__": if __name__ == "__main__":
......
...@@ -180,7 +180,7 @@ class TestRuleCreate(object): ...@@ -180,7 +180,7 @@ class TestRuleCreate(object):
monitorInterface=None, monitorType=None, monitorInterface=None, monitorType=None,
parentHost=None, businessIds=None, opsPerson=None, snmpCommunity=None, ipmiAuthtype=None, parentHost=None, businessIds=None, opsPerson=None, snmpCommunity=None, ipmiAuthtype=None,
ipmiPrivilege=None, ipmiUsername=None, ipmiPassword=None, ipmiPrivilege=None, ipmiUsername=None, ipmiPassword=None,
factory=None, model=None, version=None, serialnumber=None, factoryId=None, model=None, version=None, serialnumber=None,
description=None, monitorStatus=None): description=None, monitorStatus=None):
api = DeviceCreate(_host=self.host_create) api = DeviceCreate(_host=self.host_create)
api.token = token api.token = token
...@@ -198,7 +198,7 @@ class TestRuleCreate(object): ...@@ -198,7 +198,7 @@ class TestRuleCreate(object):
api.ipmiPrivilege = ipmiPrivilege api.ipmiPrivilege = ipmiPrivilege
api.ipmiUsername = ipmiUsername api.ipmiUsername = ipmiUsername
api.ipmiPassword = ipmiPassword api.ipmiPassword = ipmiPassword
api.factory = factory api.factoryId = factoryId
api.model = model api.model = model
api.version = version api.version = version
api.serialnumber = serialnumber api.serialnumber = serialnumber
......
...@@ -181,7 +181,7 @@ class TestRuleDelete(object): ...@@ -181,7 +181,7 @@ class TestRuleDelete(object):
monitorInterface=None, monitorType=None, monitorInterface=None, monitorType=None,
parentHost=None, businessIds=None, opsPerson=None, snmpCommunity=None, ipmiAuthtype=None, parentHost=None, businessIds=None, opsPerson=None, snmpCommunity=None, ipmiAuthtype=None,
ipmiPrivilege=None, ipmiUsername=None, ipmiPassword=None, ipmiPrivilege=None, ipmiUsername=None, ipmiPassword=None,
factory=None, model=None, version=None, serialnumber=None, factoryId=None, model=None, version=None, serialnumber=None,
description=None, monitorStatus=None): description=None, monitorStatus=None):
api = DeviceCreate(_host=self.host_create) api = DeviceCreate(_host=self.host_create)
api.token = token api.token = token
...@@ -199,7 +199,7 @@ class TestRuleDelete(object): ...@@ -199,7 +199,7 @@ class TestRuleDelete(object):
api.ipmiPrivilege = ipmiPrivilege api.ipmiPrivilege = ipmiPrivilege
api.ipmiUsername = ipmiUsername api.ipmiUsername = ipmiUsername
api.ipmiPassword = ipmiPassword api.ipmiPassword = ipmiPassword
api.factory = factory api.factoryId = factoryId
api.model = model api.model = model
api.version = version api.version = version
api.serialnumber = serialnumber api.serialnumber = serialnumber
......
...@@ -182,7 +182,7 @@ class TestRuleGet(object): ...@@ -182,7 +182,7 @@ class TestRuleGet(object):
monitorInterface=None, monitorType=None, monitorInterface=None, monitorType=None,
parentHost=None, businessIds=None, opsPerson=None, snmpCommunity=None, ipmiAuthtype=None, parentHost=None, businessIds=None, opsPerson=None, snmpCommunity=None, ipmiAuthtype=None,
ipmiPrivilege=None, ipmiUsername=None, ipmiPassword=None, ipmiPrivilege=None, ipmiUsername=None, ipmiPassword=None,
factory=None, model=None, version=None, serialnumber=None, factoryId=None, model=None, version=None, serialnumber=None,
description=None, monitorStatus=None): description=None, monitorStatus=None):
api = DeviceCreate(_host=self.host_create) api = DeviceCreate(_host=self.host_create)
api.token = token api.token = token
...@@ -201,7 +201,7 @@ class TestRuleGet(object): ...@@ -201,7 +201,7 @@ class TestRuleGet(object):
api.ipmiPrivilege = ipmiPrivilege api.ipmiPrivilege = ipmiPrivilege
api.ipmiUsername = ipmiUsername api.ipmiUsername = ipmiUsername
api.ipmiPassword = ipmiPassword api.ipmiPassword = ipmiPassword
api.factory = factory api.factoryId = factoryId
api.model = model api.model = model
api.version = version api.version = version
api.serialnumber = serialnumber api.serialnumber = serialnumber
......
...@@ -178,7 +178,7 @@ class TestRuleList(object): ...@@ -178,7 +178,7 @@ class TestRuleList(object):
monitorInterface=None, monitorType=None, monitorInterface=None, monitorType=None,
parentHost=None, businessIds=None, opsPerson=None, snmpCommunity=None, ipmiAuthtype=None, parentHost=None, businessIds=None, opsPerson=None, snmpCommunity=None, ipmiAuthtype=None,
ipmiPrivilege=None, ipmiUsername=None, ipmiPassword=None, ipmiPrivilege=None, ipmiUsername=None, ipmiPassword=None,
factory=None, model=None, version=None, serialnumber=None, factoryId=None, model=None, version=None, serialnumber=None,
description=None, monitorStatus=None): description=None, monitorStatus=None):
api = DeviceCreate(_host=self.host_create) api = DeviceCreate(_host=self.host_create)
api.token = token api.token = token
...@@ -197,7 +197,7 @@ class TestRuleList(object): ...@@ -197,7 +197,7 @@ class TestRuleList(object):
api.ipmiPrivilege = ipmiPrivilege api.ipmiPrivilege = ipmiPrivilege
api.ipmiUsername = ipmiUsername api.ipmiUsername = ipmiUsername
api.ipmiPassword = ipmiPassword api.ipmiPassword = ipmiPassword
api.factory = factory api.factoryId = factoryId
api.model = model api.model = model
api.version = version api.version = version
api.serialnumber = serialnumber api.serialnumber = serialnumber
......
...@@ -193,7 +193,7 @@ class TestRuleUpdate(object): ...@@ -193,7 +193,7 @@ class TestRuleUpdate(object):
monitorInterface=None, monitorType=None, monitorInterface=None, monitorType=None,
parentHost=None, businessIds=None, opsPerson=None, snmpCommunity=None, ipmiAuthtype=None, parentHost=None, businessIds=None, opsPerson=None, snmpCommunity=None, ipmiAuthtype=None,
ipmiPrivilege=None, ipmiUsername=None, ipmiPassword=None, ipmiPrivilege=None, ipmiUsername=None, ipmiPassword=None,
factory=None, model=None, version=None, serialnumber=None, factoryId=None, model=None, version=None, serialnumber=None,
description=None, monitorStatus=None): description=None, monitorStatus=None):
api = DeviceCreate(_host=self.host_create) api = DeviceCreate(_host=self.host_create)
api.token = token api.token = token
...@@ -211,7 +211,7 @@ class TestRuleUpdate(object): ...@@ -211,7 +211,7 @@ class TestRuleUpdate(object):
api.ipmiPrivilege = ipmiPrivilege api.ipmiPrivilege = ipmiPrivilege
api.ipmiUsername = ipmiUsername api.ipmiUsername = ipmiUsername
api.ipmiPassword = ipmiPassword api.ipmiPassword = ipmiPassword
api.factory = factory api.factoryId = factoryId
api.model = model api.model = model
api.version = version api.version = version
api.serialnumber = serialnumber api.serialnumber = serialnumber
......
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