def test_018_check_encryption_wpa_less_short_pwd(self):
     """修改加密方式为wpa2-psk,低于最短密码长度"""
     tmp = WirelessSettingsBusiness(self.driver)
     #判断wpa密码输入框是否有红色警告
     result = tmp.check_wpa_password_warning("psk2", "12345")
     self.assertTrue(result)
     log.debug("018\t\tpass")
예제 #2
0
    def test_014_clientmode_check_restore_AP_factory(self):
        """
        客户端模式下验证AP是否恢复出厂配置
        """
        tmp = ConfigUpdateBusiness(self.driver)
        #在AP的web页面上点击恢复出厂设置
        tmp.restore_AP_factory()
        #判断ssid是否恢复出厂
        tmp1 = WirelessSettingsBusiness(self.driver)
        result1 = tmp1.get_first_ssid(data_basic['DUT_ip'], data_basic['ssh_user'],
            data_basic['ssh_pwd'])
        #判断wan口是否恢复出厂
        tmp2 = WanSettingsBusiness(self.driver)
        result2 = tmp2.get_wan_way(data_basic['DUT_ip'], data_basic['ssh_user'],
            data_basic['ssh_pwd'])
        #默认ssid
        default_ssid = "3ONE_2G_"+ data.master_last_6mac()
        #登录ap后台,判断ap的工作模式
        tmp3 = WorkModeBusiness(self.driver)
        result3 = tmp3.check_DUT_workmode(data_basic['DUT_ip'], data_basic['ssh_user'],
            data_basic['ssh_pwd'])

        #设置PC的静态IP,能够访问DUT的webpage
        tmp.set_eth_ip(data_basic['lan_pc'], data_basic['static_PC_ip'])

        self.assertIn(default_ssid, result1)
        self.assertIn("dhcp", result2)
        self.assertNotIn("wds_c", result3)
        log.debug("014\t\tpass")
    def test_008_check_bridgemode_config_file_after_reboot_ap(self):
        """验证桥接模式下重启后配置文件没有丢失"""
        #关闭AP的eth1端口,以免她来分配ip地址,和桥接的dhcp server相冲突
        tmp4 = WorkModeBusiness(self.driver)
        tmp4.down_ap_eth1(data_basic['DUT_ip'], data_basic['ssh_user'],
                          data_basic['ssh_pwd'])
        tmp1 = StateInfoBusiness(self.driver)
        #获取当前模式
        result1 = tmp1.obtain_AP_current_mode()
        #获取桥接的连接状态
        result2 = tmp1.obtain_WAN_IP_generation()
        #获取信号强度
        result3 = tmp1.obtain_WAN_IP_address()

        #判断ssid是否恢复
        tmp2 = WirelessSettingsBusiness(self.driver)
        result4 = tmp2.get_first_ssid(data_basic['DUT_ip'],
                                      data_basic['ssh_user'],
                                      data_basic['ssh_pwd'])
        #登录ap后台,判断ap的工作模式
        tmp3 = WorkModeBusiness(self.driver)
        result5 = tmp3.check_DUT_workmode(data_basic['DUT_ip'],
                                          data_basic['ssh_user'],
                                          data_basic['ssh_pwd'])
        self.assertEqual(result1, "网桥模式")
        self.assertEqual(result2, "已连接")
        self.assertIn("dBm", result3)
        self.assertIn(data_wirless['all_ssid'], result4)
        self.assertIn("wds", result5)
        log.debug("008\t\tpass")
    def test_001_default_wifi(self):
        """默认无线开关为开启状态"""
        # #首先启用无线网卡
        tmp = WirelessSettingsBusiness(self.driver)
        tmp.wlan_enable(data_basic['wlan_pc'])
        #刷新页面重新登录ap页面
        Lg = LoginBusiness(self.driver)
        Lg.refresh_login_ap()
        #把AP恢复出厂配置
        tmp1 = ConfigUpdateBusiness(self.driver)
        tmp1.restore_AP_factory()
        #重新登录AP
        #逻辑类对象,建一个实例
        Lg = LoginBusiness(self.driver)
        #调用实例的登录AP的web界面
        Lg.login(data_basic['superUser'], data_basic['super_defalut_pwd'])
        #刷新页面重新登录ap页面
        Lg.refresh_login_ap()

        #使用无线网卡扫描,能够连接上默认ssid
        #默认ssid
        default_ssid = "3ONE_2G_" + data.master_last_6mac()
        print(default_ssid)
        result = tmp.client_connect_ssid(default_ssid, data_basic['wlan_pc'],
                                         "open")
        #result = tmp.ssid_scan_result_backup(default_ssid, data_basic['wlan_pc'])
        self.assertTrue(result)
        log.debug("001\t\tpass")
 def test_054_default_WMM(self):
     """验证默认开启无线多媒体"""
     tmp = WirelessSettingsBusiness(self.driver)
     result = tmp.check_ap_WMM(data_basic['DUT_ip'], data_basic['ssh_user'],
                               data_basic['ssh_pwd'])
     self.assertTrue(result)
     log.debug("054\t\tpass")
    def test_002_check_routemode_config_file_after_reboot_ap(self):
        """验证路由模式下重启后配置文件没有丢失"""
        tmp1 = StateInfoBusiness(self.driver)
        #获取当前模式
        result1 = tmp1.obtain_AP_current_mode()
        #获取外网的IP获取方式
        result2 = tmp1.obtain_WAN_IP_generation()
        #获取IP地址
        result3 = tmp1.obtain_WAN_IP_address()

        #判断ssid是否恢复
        tmp2 = WirelessSettingsBusiness(self.driver)
        result4 = tmp2.get_first_ssid(data_basic['DUT_ip'],
                                      data_basic['ssh_user'],
                                      data_basic['ssh_pwd'])
        #判断wan口是否是静态IP
        tmp3 = WanSettingsBusiness(self.driver)
        result5 = tmp3.get_wan_way(data_basic['DUT_ip'],
                                   data_basic['ssh_user'],
                                   data_basic['ssh_pwd'])
        self.assertEqual(result1, "路由模式")
        self.assertEqual(result2, "静态IP")
        self.assertEqual(data_wan['static_IP'], result3)
        self.assertIn(data_wirless['all_ssid'], result4)
        self.assertIn("static", result5)
        log.debug("002\t\tpass")
 def test_015_check_ssid_more_max(self):
     """验证SSID的字符长度限制-超过最大"""
     tmp = WirelessSettingsBusiness(self.driver)
     #判断ssid输入框是否有红色警告
     result = tmp.check_ssid_warning(data_wireless['long_ssid'] + "abc")
     self.assertTrue(result)
     log.debug("015\t\tpass")
    def test_005_check_apmode_config_file_after_reboot_ap(self):
        """验证AP模式下重启后配置文件没有丢失"""
        tmp1 = StateInfoBusiness(self.driver)
        #获取当前模式
        result1 = tmp1.obtain_AP_current_mode()
        #获取内网IP获取方式
        result2 = tmp1.obtain_WAN_IP_generation()
        #获取IP地址
        result3 = tmp1.obtain_WAN_IP_address()

        #判断ssid是否恢复
        tmp2 = WirelessSettingsBusiness(self.driver)
        result4 = tmp2.get_first_ssid(data_basic['DUT_ip'],
                                      data_basic['ssh_user'],
                                      data_basic['ssh_pwd'])
        #登录ap后台,判断ap的工作模式
        tmp3 = WorkModeBusiness(self.driver)
        result5 = tmp3.check_DUT_workmode(data_basic['DUT_ip'],
                                          data_basic['ssh_user'],
                                          data_basic['ssh_pwd'])
        self.assertEqual(result1, "AP模式")
        self.assertEqual(result2, "静态IP")
        self.assertEqual(data_basic['DUT_ip'], result3)
        self.assertIn(data_wirless['all_ssid'], result4)
        self.assertIn("ap", result5)
        log.debug("005\t\tpass")
 def test_058_default_fragment_threshold(self):
     """验证默认分割阈值为2346"""
     tmp = WirelessSettingsBusiness(self.driver)
     result = tmp.check_ap_fragment_threshold(data_basic['DUT_ip'],
                                              data_basic['ssh_user'],
                                              data_basic['ssh_pwd'], 2346)
     self.assertTrue(result)
     log.debug("058\t\tpass")
 def test_060_default_rts_threshold(self):
     """验证默认rts阈值为2347"""
     tmp = WirelessSettingsBusiness(self.driver)
     result = tmp.check_ap_rts_threshold(data_basic['DUT_ip'],
                                         data_basic['ssh_user'],
                                         data_basic['ssh_pwd'], 2347)
     self.assertTrue(result)
     log.debug("060\t\tpass")
 def test_056_default_wireless_isolate(self):
     """验证默认关闭无线隔离"""
     tmp = WirelessSettingsBusiness(self.driver)
     result = tmp.check_ap_wireless_isolate(data_basic['DUT_ip'],
                                            data_basic['ssh_user'],
                                            data_basic['ssh_pwd'])
     self.assertFalse(result)
     log.debug("056\t\tpass")
 def test_050_default_shortGI(self):
     """验证默认开启短防护时间间隔"""
     tmp = WirelessSettingsBusiness(self.driver)
     result = tmp.check_ap_shortGI(data_basic['DUT_ip'],
                                   data_basic['ssh_user'],
                                   data_basic['ssh_pwd'])
     self.assertTrue(result)
     log.debug("050\t\tpass")
 def test_020_check_encryption_wpa_more_long_pwd(self):
     """修改加密方式为wpa2-psk,高于最长密码长度"""
     tmp = WirelessSettingsBusiness(self.driver)
     #判断wpa密码输入框是否有红色警告
     result = tmp.check_wpa_password_warning(
         "psk2", data_wireless['long_wpa'] + "12")
     self.assertTrue(result)
     log.debug("020\t\tpass")
 def test_010_check_ssid_ASCII(self):
     """SSID对ASCII的支持"""
     tmp = WirelessSettingsBusiness(self.driver)
     #修改无线的ssid
     tmp.change_ssid(data_wireless['ascii_ssid'])
     #获取页面上的ssid
     result = tmp.obtain_ssid()
     self.assertEqual(data_wireless['ascii_ssid'], result)
     log.debug("010\t\tpass")
 def test_011_check_ssid_CN(self):
     """中文SSID的正常配置"""
     tmp = WirelessSettingsBusiness(self.driver)
     #修改无线的ssid
     tmp.change_ssid(data_wireless['CN_ssid'])
     #获取页面上的ssid
     result = tmp.obtain_ssid()
     self.assertEqual(data_wireless['CN_ssid'], result)
     log.debug("011\t\tpass")
 def test_037_channel13(self):
     """验证AP的信道为13时"""
     tmp = WirelessSettingsBusiness(self.driver)
     #切换2.4G无线信道,判断,无线网卡连接取出该AP的频率值
     result = tmp.check_wifi_channel(13, data_wireless['all_ssid'],
                                     data_wireless['short_wpa'],
                                     data_basic['wlan_pc'])
     self.assertEqual(result, 2472)
     log.debug("037\t\tpass")
 def test_012_check_ssid_special(self):
     """特殊符号的SSID配置"""
     tmp = WirelessSettingsBusiness(self.driver)
     #修改无线的ssid
     tmp.change_ssid(data_wireless['special_ssid'])
     #获取页面上的ssid
     result = tmp.obtain_ssid()
     self.assertEqual(data_wireless['special_ssid'], result)
     log.debug("012\t\tpass")
 def test_040_default_power(self):
     """验证默认发射功率是30dbm"""
     tmp = WirelessSettingsBusiness(self.driver)
     #登录ap的后台,检查发射功率
     result = tmp.check_ap_power(data_basic['DUT_ip'],
                                 data_basic['ssh_user'],
                                 data_basic['ssh_pwd'], "30")
     self.assertTrue(result)
     log.debug("040\t\tpass")
 def test_038_default_bandwidth(self):
     """验证默认带宽是40M"""
     tmp = WirelessSettingsBusiness(self.driver)
     #登录ap的后台,检查带宽
     result = tmp.check_ap_bandwidth(data_basic['DUT_ip'],
                                     data_basic['ssh_user'],
                                     data_basic['ssh_pwd'], "HT40")
     self.assertTrue(result)
     log.debug("038\t\tpass")
예제 #20
0
    def test_007_bridgemode_system_downgrade_check_config(self):
        """桥接模式下,修改配置后,系统降级,检查配置"""
        tmp1 = WorkModeBusiness(self.driver)
        #修改工作模式为bridge模式,内网设置静态IP
        tmp1.change_workmode_to_bridge_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_wirless['all_ssid'], "psk2", data_wirless['short_wpa'],
            data_basic['ssh_user'], data_basic['ssh_pwd'])
        time.sleep(30)
        #选择固件路径,降级固件
        PATH = os.path.join(
            os.getcwd(), AP_model + '-' + data_basic['old_version'] + '.bin')
        print(PATH)
        #逻辑类对象,建一个实例
        Lg = LoginBusiness(self.driver)
        #刷新页面重新登录ap页面
        Lg.refresh_login_ap()
        tmp = SystemUpgradeBusiness(self.driver)
        tmp.upgrade_system(PATH)
        #设置PC的静态IP,能够访问DUT的webpage
        tmp.set_eth_ip(data_basic['lan_pc'], data_basic['static_PC_ip'])
        #关闭AP的eth1端口,以免她来分配ip地址,和桥接的dhcp server相冲突
        tmp4 = WorkModeBusiness(self.driver)
        tmp4.down_ap_eth1(data_basic['DUT_ip'], data_basic['ssh_user'],
                          data_basic['ssh_pwd'])
        #刷新页面重新登录ap页面
        Lg.refresh_login_ap()
        tmp1 = StateInfoBusiness(self.driver)
        #获取当前模式
        result1 = tmp1.obtain_AP_current_mode()
        #获取桥接的连接状态
        result2 = tmp1.obtain_WAN_IP_generation()
        #获取信号强度
        result3 = tmp1.obtain_WAN_IP_address()

        #判断ssid是否恢复
        tmp2 = WirelessSettingsBusiness(self.driver)
        result4 = tmp2.get_first_ssid(data_basic['DUT_ip'],
                                      data_basic['ssh_user'],
                                      data_basic['ssh_pwd'])
        #登录ap后台,判断ap的工作模式
        tmp3 = WorkModeBusiness(self.driver)
        result5 = tmp3.check_DUT_workmode(data_basic['DUT_ip'],
                                          data_basic['ssh_user'],
                                          data_basic['ssh_pwd'])
        #检查固件版本
        result6 = tmp.check_system_version(data_basic['old_version'])
        self.assertEqual(result1, "网桥模式")
        self.assertEqual(result2, "已连接")
        self.assertIn("dBm", result3)
        self.assertIn(data_wirless['all_ssid'], result4)
        self.assertIn("wds", result5)
        self.assertTrue(result6)
        log.debug("007\t\tpass")
 def test_019_encryption_wpa_long_pwd(self):
     """修改加密方式为wpa2-psk,最长密码长度"""
     tmp = WirelessSettingsBusiness(self.driver)
     #修改加密方式为wpa2-psk
     tmp.change_wifi_encryption_pwd("psk2", data_wireless['long_wpa'])
     #使用无线网卡连接该ssid
     result = tmp.client_connect_ssid(data_wireless['all_ssid'],
                                      data_basic['wlan_pc'], "wpa",
                                      data_wireless['long_wpa'])
     self.assertIn(data_wireless['all_ssid'], result)
     log.debug("019\t\tpass")
예제 #22
0
    def test_005_apmode_system_downgrade_check_config(self):
        """ap模式下,修改配置后,系统降级,检查配置"""
        tmp1 = WorkModeBusiness(self.driver)
        #设置PC的静态IP,能够访问DUT的webpage
        tmp1.set_eth_ip(data_basic['lan_pc'], data_basic['static_PC_ip'])
        #修改工作模式为AP模式,内网设置静态IP
        tmp1.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()
        #选择固件路径,降级固件
        PATH = os.path.join(
            os.getcwd(), AP_model + '-' + data_basic['old_version'] + '.bin')
        print(PATH)
        tmp = SystemUpgradeBusiness(self.driver)
        tmp.upgrade_system(PATH)
        #设置PC的静态IP,能够访问DUT的webpage
        tmp.set_eth_ip(data_basic['lan_pc'], data_basic['static_PC_ip'])
        #刷新页面重新登录ap页面
        Lg.refresh_login_ap()
        tmp1 = StateInfoBusiness(self.driver)
        #获取当前模式
        result1 = tmp1.obtain_AP_current_mode()
        #获取内网IP获取方式
        result2 = tmp1.obtain_WAN_IP_generation()
        #获取IP地址
        result3 = tmp1.obtain_WAN_IP_address()

        #判断ssid是否恢复
        tmp2 = WirelessSettingsBusiness(self.driver)
        result4 = tmp2.get_first_ssid(data_basic['DUT_ip'],
                                      data_basic['ssh_user'],
                                      data_basic['ssh_pwd'])
        #登录ap后台,判断ap的工作模式
        tmp3 = WorkModeBusiness(self.driver)
        result5 = tmp3.check_DUT_workmode(data_basic['DUT_ip'],
                                          data_basic['ssh_user'],
                                          data_basic['ssh_pwd'])
        #检查固件版本
        result6 = tmp.check_system_version(data_basic['old_version'])
        self.assertEqual(result1, "AP模式")
        self.assertEqual(result2, "静态IP")
        self.assertEqual(data_basic['DUT_ip'], result3)
        self.assertIn(data_wirless['all_ssid'], result4)
        self.assertIn("ap", result5)
        self.assertTrue(result6)
        log.debug("005\t\tpass")
 def test_002_disable_wifi(self):
     """关闭无线,无线网卡扫描不到ssid"""
     #关闭无线
     tmp = WirelessSettingsBusiness(self.driver)
     tmp.change_wifi_switch()
     #使用无线网卡扫描,不能扫描到ssid
     #默认ssid
     default_ssid = "3ONE_2G_" + data.master_last_6mac()
     result = tmp.ssid_scan_result(default_ssid, data_basic['wlan_pc'])
     self.assertFalse(result)
     log.debug("002\t\tpass")
 def test_009_check_ssid_letter_digital(self):
     """SSID对英文+数字的支持"""
     tmp = WirelessSettingsBusiness(self.driver)
     #修改无线的ssid
     tmp.change_ssid(data_wireless['digital_letter_ssid'])
     #无线能够能够连接ssid成功
     result = tmp.client_connect_ssid(data_wireless['digital_letter_ssid'],
                                      data_basic['wlan_pc'], "wpa",
                                      data_wireless['short_wpa'])
     self.assertIn(data_wireless['digital_letter_ssid'], result)
     log.debug("009\t\tpass")
 def test_044_power_10(self):
     """修改发射功率是10"""
     tmp = WirelessSettingsBusiness(self.driver)
     #修改发射功率
     tmp.change_power("10")
     #登录ap的后台,检查带宽
     result = tmp.check_ap_power(data_basic['DUT_ip'],
                                 data_basic['ssh_user'],
                                 data_basic['ssh_pwd'], "10")
     self.assertTrue(result)
     log.debug("044\t\tpass")
 def test_039_bandwidth_20M(self):
     """修改带宽是20M"""
     tmp = WirelessSettingsBusiness(self.driver)
     #修改带宽
     tmp.change_bandwidth("HT20")
     #登录ap的后台,检查带宽
     result = tmp.check_ap_bandwidth(data_basic['DUT_ip'],
                                     data_basic['ssh_user'],
                                     data_basic['ssh_pwd'], "HT20")
     self.assertTrue(result)
     log.debug("039\t\tpass")
 def test_014_check_ssid_max(self):
     """验证SSID的字符长度限制-最大"""
     tmp = WirelessSettingsBusiness(self.driver)
     #修改无线的ssid
     tmp.change_ssid(data_wireless['long_ssid'])
     #无线能够能够连接ssid成功
     result = tmp.client_connect_ssid(data_wireless['long_ssid'],
                                      data_basic['wlan_pc'], "wpa",
                                      data_wireless['short_wpa'])
     self.assertIn(data_wireless['long_ssid'], result)
     log.debug("014\t\tpass")
 def test_025_channel1(self):
     """验证AP的信道为1时"""
     tmp = WirelessSettingsBusiness(self.driver)
     #首先修改加密方式为wpa2-psk
     tmp.change_wifi_encryption_pwd("psk2", data_wireless['short_wpa'])
     #切换2.4G无线信道,判断,无线网卡连接取出该AP的频率值
     result = tmp.check_wifi_channel(1, data_wireless['all_ssid'],
                                     data_wireless['short_wpa'],
                                     data_basic['wlan_pc'])
     self.assertEqual(result, 2412)
     log.debug("025\t\tpass")
 def test_023_encryption_wep128_13pwd(self):
     """修改加密方式为wep128bit,13位密码"""
     tmp = WirelessSettingsBusiness(self.driver)
     #修改加密方式为wep128bit,13位密码
     tmp.change_wifi_encryption_pwd("wep+shared", data_wireless['wep128'])
     #使用无线网卡连接该ssid
     result = tmp.client_connect_ssid(data_wireless['all_ssid'],
                                      data_basic['wlan_pc'], "wep",
                                      data_wireless['wep128'])
     self.assertIn(data_wireless['all_ssid'], result)
     log.debug("023\t\tpass")
 def test_003_enable_wifi(self):
     """开启无线,无线网卡能够扫描到ssid"""
     #开启无线
     tmp = WirelessSettingsBusiness(self.driver)
     tmp.change_wifi_switch()
     #使用无线网卡扫描,能够连接上默认ssid
     #默认ssid
     default_ssid = "3ONE_2G_" + data.master_last_6mac()
     result = tmp.client_connect_ssid(default_ssid, data_basic['wlan_pc'],
                                      "open")
     self.assertTrue(result)
     log.debug("003\t\tpass")