def test_018_del_client_name(self): u"""删除设置用户名称后,用户再次连接后主机名显示为用户本身名字(testlink_ID:516)""" log.debug("018") tmp = ClientsBusiness(self.driver) wlan_mac = tmp.get_wlan_mac(data_basic['wlan_pc']) #只有一个客户端时,修改客户端名称 tmp.change_client_name(wlan_mac, "") #重启ap tmp1 = UpgradeBusiness(self.driver) tmp1.web_reboot(data_basic['DUT_ip']) tmp1.connect_DHCP_WPA_AP(data_wireless['all_ssid'],\ data_wireless['short_wpa'],data_basic['wlan_pc']) tmp.dhcp_release_wlan(data_basic['wlan_pc']) self.driver.refresh() self.driver.implicitly_wait(10) #登录AP Lg = LoginBusiness(self.driver) Lg.login(data_basic['superUser'], data_login['all']) #获取第一个客户端的名称 result = tmp.check_client_name(wlan_mac) #取测试平台的name PC_name = subprocess.check_output("hostname", shell=True).strip("\n") print result, PC_name # tmp.dhcp_release_wlan(data_basic['wlan_pc']) assert (result == PC_name) or (result == ""), "del client name,test fail!" print "del client name,test pass!"
def test_004_check_ip(self): u"""IP地址信息核对(testlink_ID:489)--bug78714""" log.debug("004") tmp = ClientsBusiness(self.driver) #点击客户端菜单 tmp.clients_menu() #获取第一个客户端的IP地址 wlan_mac = tmp.get_wlan_mac(data_basic['wlan_pc']) result = tmp.get_client_IP(wlan_mac) print "client ip on Client page is " + result tmp.dhcp_release_wlan(data_basic['wlan_pc']) assert result != "", "Check IP address on client page,test fail!" print "Check IP address on client page,test pass!"
def test_034_failover_master_can_modify_client_configuration(self): u"""failover ap 切换到master ap模式后,能够修改client的配置(testlink_ID:2384)""" log.debug("034") tmp = APSBusiness(self.driver) #登录failover ap的web界面 tmp.login_failover_ap(data_basic['slave_web2'], data_basic['superUser'], data_login['all']) #修改客户端名字 tmp1 = ClientsBusiness(self.driver) mac = tmp1.get_wlan_mac(data_basic['wlan_pc']) tmp1.change_client_name(mac, data_Client['letter_digital_name']) #获取第一个客户端的名称 time.sleep(60) result = tmp1.check_client_name(mac) tmp1.dhcp_release_wlan(data_basic['wlan_pc']) self.assertEqual(data_Client['letter_digital_name'], result), "after failover change to master can modify client configuration, test fail!" print "after failover change to master can modify client configuration, test pass!"
def test_002_connect_clients_info(self): u"""无线网卡连接上ap后,查看客户端信息(testlink_ID:485)""" log.debug("002") tmp = ClientsBusiness(self.driver) Lg = LoginBusiness(self.driver) #使用无线网卡能够连接上ssid,并正常使用 tmp.connect_DHCP_WPA_AP(data_wireless['all_ssid'], data_wireless['short_wpa'], data_basic['wlan_pc']) tmp.dhcp_release_wlan(data_basic['wlan_pc']) Lg.refresh_login_ap() #获取客户端的mac地址 result1 = tmp.check_client(data_basic['wlan_pc']) wlan_mac = tmp.get_wlan_mac(data_basic['wlan_pc']) result2 = tmp.get_online_status(wlan_mac) print result1, result2 assert result1 and ( (u"在线" or 'Online') in result2), "test after connecting ap,clients info,test fail!" print "test after connecting ap,clients info,test pass!"