예제 #1
0
 def test_013_clientmode_save_config_file(self):
     """客户端模式下保存配置"""
     tmp = WorkModeBusiness(self.driver)
     #修改工作模式为client模式,内网设置静态IP,桥接ap无线加密为wpa2
     tmp.change_workmode_to_client_LANstaticIP(data_basic['DUT_ip'], data_lan['netmask1'],
         data_wirless['bridge_essid'], data_wirless['bridge_encryption'],
         data_wirless['bridge_bssid'], data_wirless['bridge_pwd'],
         data_basic['ssh_user'], data_basic['ssh_pwd'])
     #逻辑类对象,建一个实例
     Lg = LoginBusiness(self.driver)
     #刷新页面重新登录ap页面
     Lg.refresh_login_ap()
     #下载配置文件
     tmp1 = ConfigUpdateBusiness(self.driver)
     tmp1.download_config_file()
     #判断配置文件是否下载
     #文件路径
     PATH = os.path.join(os.getcwd(), "bakup.file")
     print(PATH)
     result = os.path.exists(PATH)
     #登录ap后台,判断ap的工作模式
     result5 = tmp.check_DUT_workmode(data_basic['DUT_ip'], data_basic['ssh_user'],
         data_basic['ssh_pwd'])
     self.assertTrue(result)
     self.assertIn("wds_c", result5)
     log.debug("013\t\tpass")
예제 #2
0
 def test_005_apmode_save_config_file(self):
     """AP模式下保存配置"""
     tmp = WorkModeBusiness(self.driver)
     #设置PC的静态IP,能够访问DUT的webpage
     tmp.set_eth_ip(data_basic['lan_pc'], data_basic['static_PC_ip'])
     #修改工作模式为AP模式,内网设置静态IP
     tmp.change_workmode_to_ap_LANstaticIP(data_basic['DUT_ip'],
         data_lan['netmask1'], data_wirless['all_ssid'], "psk2",
         data_wirless['short_wpa'], "HT20")
     time.sleep(30)
     #逻辑类对象,建一个实例
     Lg = LoginBusiness(self.driver)
     #刷新页面重新登录ap页面
     Lg.refresh_login_ap()
     #下载配置文件
     tmp1 = ConfigUpdateBusiness(self.driver)
     tmp1.download_config_file()
     #判断配置文件是否下载
     #文件路径
     PATH = os.path.join(os.getcwd(), "bakup.file")
     print(PATH)
     result = os.path.exists(PATH)
     #登录ap后台,判断ap的工作模式
     result5 = tmp.check_DUT_workmode(data_basic['DUT_ip'], data_basic['ssh_user'],
         data_basic['ssh_pwd'])
     self.assertTrue(result)
     self.assertIn("ap", result5)
     log.debug("005\t\tpass")
예제 #3
0
 def test_001_routemode_save_config_file(self):
     """路由模式下保存配置"""
     #首先启用无线网卡
     tmp = ConfigUpdateBusiness(self.driver)
     tmp.wlan_enable(data_basic['wlan_pc'])
     #刷新页面重新登录ap页面
     Lg = LoginBusiness(self.driver)
     Lg.refresh_login_ap()
     #把AP恢复出厂配置
     tmp3 = ConfigUpdateBusiness(self.driver)
     tmp3.restore_AP_factory()
     #重新登录AP
     #调用实例的登录AP的web界面
     Lg.login(data_basic['superUser'], data_basic['super_defalut_pwd'])
     #刷新页面重新登录ap页面
     Lg.refresh_login_ap()
     #修改工作模式为路由模式,外网设置static IP模式
     tmp1 = WorkModeBusiness(self.driver)
     tmp1.change_workmode_to_route_WANstaticIP(data_wan['static_IP'],
         data_wan['netmask'], data_wan['gateway'], data_wan['DNS'],
         data_wirless['all_ssid'],"psk2", data_wirless['short_wpa'], "HT20", "auto")
     time.sleep(60)
     #逻辑类对象,建一个实例
     Lg = LoginBusiness(self.driver)
     #刷新页面重新登录ap页面
     Lg.refresh_login_ap()
     #下载配置文件
     tmp.download_config_file()
     #判断配置文件是否下载
     #文件路径
     PATH = os.path.join(os.getcwd(), "bakup.file")
     print(PATH)
     result = os.path.exists(PATH)
     #判断wan口是否是静态IP
     tmp3 = WanSettingsBusiness(self.driver)
     result5 = tmp3.get_wan_way(data_basic['DUT_ip'], data_basic['ssh_user'],
         data_basic['ssh_pwd'])
     self.assertTrue(result)
     self.assertIn("static", result5)
     log.debug("001\t\tpass")