def test_004_Platform_Administrator_add_network(self): u"""平台管理员-添加网络组""" log.debug("004") #获取登录名对应的id tmp1 =UserBusiness(self.s) #使用测试用户登录 tmp1.webLogin(data_basic['Cloud_test_user'], data_basic['Cloud_test_pwd']) user_id = tmp1.get_network_id(data_basic['Cloud_test_user']) tmp = NetworkListBusiness(self.s) #添加网络组 tmp.add_network("group1", user_id, "") time.sleep(60) #获取网络组对应的id--监控面板--网络列表 network_id = tmp.get_network_id("group1") self.assertNotEqual(network_id, None)
def test_001_add_network(self): u"""创建新的网络组并判断是否添加成功""" log.debug("001") #获取登录名对应的id tmp1 =UserBusiness(self.s) #描述:启用无线网卡 tmp1.wlan_enable(data_basic['wlan_pc']) tmp1.dhcp_release_wlan(data_basic['wlan_pc']) user_id = tmp1.get_network_id(data_basic['cloud_user']) tmp = NetworkListBusiness(self.s) #添加网络组 tmp.add_network("group1", user_id, "") time.sleep(60) #获取网络组对应的id--监控面板--网络列表 network_id = tmp.get_network_id("group1") self.assertNotEqual(network_id, None)
def test_001_add_2_network_cloud(self): u"""cloud中添加两个netwrok,并且判断是否成功""" log.debug("001") tmp = APSBusiness(self.s) #描述:启用无线网卡 tmp.wlan_enable(data_basic['wlan_pc']) tmp.dhcp_release_wlan(data_basic['wlan_pc']) #获取登录名对应的id tmp1 = UserBusiness(self.s) user_id = tmp1.get_network_id(data_basic['cloud_user']) tmp2 = NetworkListBusiness(self.s) #添加2个网络组 result = tmp2.add_network("group1", user_id, "") result1 = tmp2.add_network("group2", user_id, "") #获取网络组对应的id--监控面板--网络列表 network_id = tmp2.get_network_id("group1") network_id1 = tmp2.get_network_id("group2") self.assertEqual(network_id, int(result['data']['value'])) self.assertEqual(network_id1, int(result1['data']['value']))
def test_011_Network_Administrator_add_network(self): u"""网络管理员-不能添加网络组""" log.debug("011") #获取登录名对应的id tmp1 =UserBusiness(self.s) #使用测试用户登录 tmp1.webLogin(data_basic['Cloud_test_user'], data_basic['Cloud_test_pwd']) user_id = tmp1.get_network_id(data_basic['Cloud_test_user']) tmp = NetworkListBusiness(self.s) #添加网络组 result = tmp.add_network("group1", user_id, "") self.assertFalse(result)
def test_014_Guest_Editor_add_network(self): u"""访客管理员-不能添加网络组""" log.debug("014") #获取登录名对应的id tmp1 =UserBusiness(self.s) #使用admin登录 tmp1.webLogin(data_basic['cloud_user'], data_basic['cloud_pwd']) time.sleep(60) user_id = tmp1.get_network_id(data_basic['Cloud_test_user']) #admin用户退出登录 tmp1.webLogout() #使用测试用户登录 tmp1.webLogin(data_basic['Cloud_test_user'], data_basic['Cloud_test_pwd']) tmp = NetworkListBusiness(self.s) #添加网络组 result = tmp.add_network("group1", user_id, "") self.assertFalse(result)