def test_013_slave_AP_client_num(self): u"""终端设备关联在Slave AP上,检查用户数量统计是否正确(testlink_ID:1155,1156)""" log.debug("013") #新增一个ssid NG2_ssid = "%s-2"%data_ng["NG2_ssid"] Add = SSIDBusiness(self.driver) Add.new_vlan_ssid(NG2_ssid,data_wireless["short_wpa"],"2") #多个网络组时,搜索-配对-加入ssid tmp1 = APSBusiness(self.driver) tmp1.search_pair_add(2,data_ap["slave:mac2"]) #使用无线连接slave AP tmp1.connect_DHCP_WPA_AP(NG2_ssid,\ data_wireless["short_wpa"],data_basic['wlan_pc']) #等待2分钟 time.sleep(120) tmp = OVBusiness(self.driver) tmp.OV_menu() #获取2.4G客户端数 result1 = tmp.get_2g4_client() #获取5G客户端数 result2 = tmp.get_5g_client() #释放无线网卡的ip tmp.dhcp_release_wlan(data_basic['wlan_pc']) tmp.disconnect_ap() assert (result1 == "1") or (result2 == "1"),\ "check clients number when client connect slave AP,test fail!" print "check clients number when client connect slave AP,test pass!"
def test_017_check_AP_webpage(self): u"""Client数量和状态必须与AP配置页面的client信息一致(testlink_ID:1161)""" log.debug("017") tmp = OVBusiness(self.driver) #获取2.4G客户端数 result1 = tmp.get_2g4_client() #获取5G客户端数 result2 = tmp.get_5g_client() result = (int(result1)+int(result2)) #获取所有用户设备数 tmp1 = APSBusiness(self.driver) num = tmp1.check_users_num() assert result == num,"check client number is different as AP webpage,test fail!" print "check client number is same as AP webpage,test pass!"
def test_016_check_Clients_webpage(self): u"""Client数量和状态必须与客户端页面的信息一致(testlink_ID:1160)""" log.debug("016") tmp = OVBusiness(self.driver) #获取2.4G客户端数 result1 = tmp.get_2g4_client() #获取5G客户端数 result2 = tmp.get_5g_client() result = (int(result1)+int(result2)) tmp1 = ClientsBusiness(self.driver) tmp1.clients_menu() num = tmp1.get_clients_num() assert result == num,"check client number is different as Clients webpage,test fail!" print "check client number is same as Clients webpage,test pass!"
def test_010_clients_num(self): u"""2.4G/5G 用户数量统计(testlink_ID:1151,1152)""" log.debug("010") tmp = OVBusiness(self.driver) #获取2.4G客户端数 result1 = tmp.get_2g4_client() #获取5G客户端数 result2 = tmp.get_5g_client() #释放无线网卡的ip tmp.dhcp_release_wlan(data_basic['wlan_pc']) #AP切换到2.4G Lg = LoginBusiness(self.driver) Lg.refresh_login_ap() tmp1 = SSIDBusiness(self.driver) tmp1.change_AP_Freq("2.4GHz") assert (result1 == "1") or (result2 == "1"),"check clients number,test fail!" print "check clients number,test pass!"
def test_014_unpair_client_num(self): u"""AP解除配对后,只要在客户端列表,依然统计在该AP上关联的终端设备(testlink_ID:1158)""" log.debug("014") #解除最后一个slave AP的配对 tmp1 = APSBusiness(self.driver) tmp1.unpair_last_slave_ap(1) tmp = OVBusiness(self.driver) tmp.OV_menu() #获取2.4G客户端数 result1 = tmp.get_2g4_client() #获取5G客户端数 result2 = tmp.get_5g_client() #使用无线连接master AP tmp.connect_WPA_AP(data_wireless['all_ssid'],\ data_wireless["short_wpa"],data_basic['wlan_pc']) assert (result1 == "1") or (result2 == "1"),\ "check clients number when client connect slave AP,test fail!" print "check clients number when client connect slave AP,test pass!"
def test_012_5g_client_num(self): u"""终端设备在5G上, 检查用户数量统计是否正确(testlink_ID:1153_2)""" log.debug("012") tmp = OVBusiness(self.driver) #使用无线连接该AP tmp.connect_DHCP_WPA_AP(data_wireless['all_ssid'],\ data_wireless["short_wpa"],data_basic['wlan_pc']) time.sleep(120) # 获取5G客户端数 result = tmp.get_5g_client() tmp.dhcp_release_wlan(data_basic['wlan_pc']) #释放无线网卡的ip tmp.disconnect_ap() #AP切换到双频 #切换Dual-Band频段 Lg = LoginBusiness(self.driver) Lg.refresh_login_ap() tmp1 = SSIDBusiness(self.driver) tmp1.change_AP_Freq("Dual-Band") #7000上新建一个网络组,vid设为2,开启dhcp server tmp2 = NGBusiness(self.driver) tmp2.mixed_7000_new_NG() assert result == "1","check 5G client number,test fail!" print "check 5G client number,test pass!"