def test_019_config_master_ap_setup_failover_ap(self): u"""准备好master ap的配置及流量,设置好failover ap""" log.debug("019") tmp = APSBusiness(self.driver) #解除特定slave AP1的配对 tmp.unpair_special_slave_AP(data_AP['slave:mac1']) #web页面退出登录 tmp2 = NavbarBusiness(self.driver) tmp2.logout() #AP 下载/上传流量---master ap tmp1 = OVBusiness(self.driver) tmp1.set_AP_download_unload(data_wireless['all_ssid'], data_wireless["short_wpa"], data_basic['wlan_pc'], data_basic['lan_pc']) #重新登录AP Lg = LoginBusiness(self.driver) Lg.login(data_basic['superUser'], data_login['all']) #多个slave ap时,搜索并配对特定的ap tmp.search_pair_special_AP(data_AP['slave:mac2']) #设置slave ap为failover ap tmp.change_slave_to_failover(data_AP['slave:mac2']) #检查slave ap是否变为failover ap result = tmp.check_change_to_failover_AP(data_AP['slave:mac2'], data_basic['DUT_ip'], data_basic['sshUser'], data_login['all']) self.assertTrue(result), "master ap and set failover ap ready, test fail!" print "master ap and set failover ap ready, test pass!"
def test_037_failover_check_flow(self): u"""failover ap 切换到master ap模式后,检查ap流量能正确显示(testlink_ID:2409)""" log.debug("037") tmp = APSBusiness(self.driver) #master ap关闭controller tmp.close_master_controller(data_basic['DUT_ip'], data_basic['sshUser'], data_login['all']) #等待10分钟 time.sleep(610) #登录failover ap的web界面 tmp.login_failover_ap(data_basic['slave_web2'], "failover", data_login['all']) #AP 下载/上传流量---master ap tmp1 = OVBusiness(self.driver) tmp1.set_AP_download_unload(data_ng['NG2_ssid'], data_wireless["short_wpa"], data_basic['wlan_pc'], data_basic['lan_pc']) # 作为failover登录AP Lg = LoginBusiness(self.driver) Lg.login("failover", data_login['all']) #获取第一个ap下载流量 result1, result2 = tmp1.get_AP_download() assert ("MB" in result1) or ("GB" in result1) self.assertLess(0, result2), "after failover change to master check ap traffic,test fail!" print "after failover change to master check ap traffic,test pass!"