def test_001_factory_reset_setupwizard(self):
        u"""在页面上把AP恢复出厂设置,并运行设置向导并配对slave ap,修改ssid,密码(testlink_ID:773)"""
        log.debug("001")
        #如果登录没有成功,再次使用默认密码登录;如果登录成功则直接退出
        Lg = LoginBusiness(self.driver)
        Lg.login_again()
        tmp = APSBusiness(self.driver)
        #描述:启用无线网卡
        tmp.wlan_enable(data_basic['wlan_pc'])
        #rsyslog服务器准备
        tmp.ready_rsyslog()
        result1 = tmp.web_factory_reset(data_basic['DUT_ip'],data_basic['sshUser'],\
                               data_basic['super_defalut_pwd'])
        #运行设置向导并配对slave ap,修改ssid,密码
        time.sleep(60)
        tmp1 = SWBusiness(self.driver)
        result2 = tmp1.complete_backup(data_wireless['all_ssid'],
                                       data_wireless['short_wpa'],
                                       data_basic['wlan_pc'],
                                       data_ap["slave:mac2"])

        tmp.connect_DHCP_WPA_AP(data_wireless['all_ssid'],
                                data_wireless['short_wpa'],
                                data_basic['wlan_pc'])
        #禁用启用有线网卡,以便无线网卡能够在ap的client页面显示在线
        tmp.wlan_disable(data_basic['lan_pc'])
        tmp.wlan_enable(data_basic['lan_pc'])
        time.sleep(60)
        tmp.dhcp_release_wlan(data_basic["wlan_pc"])

        print result1, result2
        assert result1 and result2, "reset the AP defalut config and run setupwizard in webpage,fail!"
        print "reset the AP defalut config and run setupwizard in webpage,pass!"
Esempio n. 2
0
 def test_017_setupwizard_add_slave_ap(self):
     u"""网络组-添加AP(testlink_ID:1302)"""
     log.debug("017")
     tmp = SWBusiness(self.driver)
     result = tmp.add_slave_ap(data_AP['slave:mac2'])
     print result
     assert result, "test adding slave ap,test fail!"
     print "test adding slave ap,test pass!"
Esempio n. 3
0
 def test_020_setupwizard_del_ap(self):
     u"""网络组-移除AP(testlink_ID:1304)"""
     log.debug("020")
     tmp = SWBusiness(self.driver)
     result = tmp.del_ap(data_AP['slave:mac2'], data_basic['slave_ip2'],
                         data_basic['sshUser'], data_login['all'])
     assert result, "test delete ap,test fail!"
     print "test delete ap,test pass!"
Esempio n. 4
0
 def test_013_setupwizard_wifi_status(self):
     u"""网络组-默认wifi状态(testlink_ID:1298)"""
     log.debug("013")
     tmp = SWBusiness(self.driver)
     result = tmp.wifi_status()
     print result
     assert result == 'true', "test defalut wifi status,test fail!"
     print "test defalut wifi status,test pass!"
Esempio n. 5
0
 def test_014_setupwizard_defalut_ssid(self):
     u"""网络组-默认SSID(testlink_ID:1299)"""
     log.debug("014")
     tmp = SWBusiness(self.driver)
     result = tmp.check_default_ssid(data_AP['master:mac'])
     print result
     assert result, "test defalut ssid,test fail!"
     print "test defalut ssid,test pass!"
Esempio n. 6
0
 def test_002_setupwizard_first_login(self):
     u"""初次登陆显示设置向导(testlink_ID:1289)"""
     log.debug("002")
     value = SWBusiness(self.driver)
     result = value.check_wizard()
     print result
     assert result, "test login webpage first display setupwizard,test fail!"
     print "test login webpage first display setupwizard,test pass!"
Esempio n. 7
0
 def test_012_setupwizard_pair_slaveAP(self):
     u"""AP发现-slave AP配对(testlink_ID:1297)"""
     log.debug("012")
     tmp = SWBusiness(self.driver)
     result = tmp.pair_slaveAP(data_AP['slave:mac2'])
     print result
     assert result == True, "test pair slave AP,test fail!"
     print "test pair slave AP,test pass!"
Esempio n. 8
0
 def test_011_setupwizard_slaveAP_status(self):
     u"""AP发现-slave AP(testlink_ID:1296)"""
     log.debug("011")
     tmp = SWBusiness(self.driver)
     result = tmp.AP_status(data_AP['master:mac'], data_AP['slave:mac1'],
                            data_AP['slave:mac2'])
     print result
     assert result[0] == True, "test slave AP status,test fail!"
     print "test slave AP status,test pass!"
Esempio n. 9
0
 def test_010_setupwizard_masterAP_status(self):
     u"""AP发现-master AP状态(testlink_ID:1295)"""
     log.debug("010")
     tmp = SWBusiness(self.driver)
     result = tmp.AP_status(data_AP['master:mac'], data_AP['slave:mac1'],
                            data_AP['slave:mac2'])
     print result
     assert result == [True, True], "test master AP status,test fail!"
     print "test master AP status,test pass!"
Esempio n. 10
0
 def test_008_setupwizard_enable(self):
     u"""En下次不再显示,再次登录不再显示设置向导窗口(testlink_ID:1293_2)"""
     log.debug("008")
     #再次登录不再显示设置向导窗口
     tmp = SWBusiness(self.driver)
     result = tmp.check_wizard()
     print result
     assert result == False, "test enable don't display nexttime,test fail!"
     print "test enable don't display nexttime,test pass!"
Esempio n. 11
0
 def test_016_setupwizard_defalut_devices(self):
     u"""网络组-默认设备(testlink_ID:1300)"""
     log.debug("016")
     tmp = SWBusiness(self.driver)
     result = tmp.default_devices(data_AP['slave:mac2'],
                                  data_AP['master:mac'])
     print result
     assert result, "test defalut devices,test fail!"
     print "test defalut devices,test pass!"
Esempio n. 12
0
 def test_018_setupwizard_dis_wifi(self):
     u"""网络组-disable wifi(testlink_ID:1303_1)"""
     log.debug("018")
     tmp = SWBusiness(self.driver)
     #取得应该的ssid
     ssid = tmp.default_ssid(data_AP['master:mac'])
     result1 = tmp.disable_wifi(ssid, data_basic['wlan_pc'])
     assert result1 == False, "test disable wifi,test fail!"
     print "test disable wifi,test pass!"
Esempio n. 13
0
 def test_006_setupwizard_disable(self):
     u"""Dis下次不再显示,再次登录依然显示设置向导窗口(testlink_ID:1292_2)"""
     log.debug("006")
     #再次登录依然显示设置向导窗口
     tmp = SWBusiness(self.driver)
     result = tmp.check_wizard()
     print result
     assert result == True, "test disable don't display nexttime,test fail!"
     print "test disable don't display nexttime,test pass!"
Esempio n. 14
0
 def test_019_setupwizard_en_wifi(self):
     u"""网络组-Enable wifi(testlink_ID:1303_2)"""
     log.debug("019")
     tmp = SWBusiness(self.driver)
     result2 = tmp.enable_wifi(data_wireless['letter_ssid'],
                               data_wireless['short_wpa'],
                               data_basic['wlan_pc'])
     assert result2, "test enable wifi,test fail!"
     print "test enable wifi,test pass!"
Esempio n. 15
0
 def test_005_setupwizard_disable(self):
     u"""Dis下次不再显示,关闭设备向导,点击其他页面判断是否有无设置向导窗口(testlink_ID:1292_1)"""
     log.debug("005")
     #关闭设备向导,点击其他页面判断是否有无设置向导窗口
     tmp = SWBusiness(self.driver)
     result = tmp.close_wizard_click_othermenu()
     print result
     assert result == False, "test disable don't display nexttime,test fail!"
     print "test disable don't display nexttime,test pass!"
Esempio n. 16
0
 def test_003_setupwizard_default_config(self):
     u"""下次不显示的默认状态没有勾选(testlink_ID:1290)"""
     log.debug("003")
     tmp = SWBusiness(self.driver)
     #下次不再显示是否被选中
     result = tmp.get_hidenexttime()
     print result
     assert result == None, "Don't show me this again has not been checked,test fail!"
     print "Don't show me this again has not been checked,test pass!"
Esempio n. 17
0
 def test_009_setupwizard_other(self):
     u"""其他页面点击向导(testlink_ID:1294)"""
     log.debug("009")
     #进入接入点确定没有设置向导窗口
     tmp = SWBusiness(self.driver)
     result = tmp.othermenu_click()
     print result
     assert result == [True, True, True, True
                       ], "test click wizard in other webpage,test fail!"
     print "test click wizard in other webpage,test pass!"
Esempio n. 18
0
 def test_021_setupwizard_unpair_slave_ap(self):
     u"""解除配对(testlink_ID:1305)"""
     log.debug("021")
     tmp = SWBusiness(self.driver)
     result = tmp.unpair_slave_ap(data_basic['slave_ip2'],
                                  data_basic['sshUser'],
                                  data_basic['super_defalut_pwd'])
     print result
     assert result, "unpair slave ap,test fail!"
     print "unpair slave ap,test pass!"
Esempio n. 19
0
 def test_007_setupwizard_enable(self):
     u"""En下次不再显示,点击下次不再显示,点击其他页面判断是否有无设置向导窗口(testlink_ID:1293_1)"""
     log.debug("007")
     tmp = SWBusiness(self.driver)
     ##点击下次不再显示
     tmp.hidenexttime()
     result = tmp.close_wizard_click_othermenu()
     print result
     assert result == False, "test enable don't display nexttime,test fail!"
     print "test enable don't display nexttime,test pass!"
Esempio n. 20
0
 def test_004_setupwizard_startcontent(self):
     u"""提示信息检查(testlink_ID:1291)"""
     log.debug("004")
     tmp = SWBusiness(self.driver)
     #获取提示信息
     result = tmp.get_startcontent()
     print result
     assert (u'此设置向导将会指导您完成GWN设备的基本设置. 若不想下次再自动显示此向导, 可勾选下方的"下次不再显示", 当然, 您也可以通过点击上方操作栏的帮助图标进入此向导.' \
            or "The setup wizard will guide you through the basic setup of your GWN product. If you don't wish to see this wizard again, please check the box below. You can always maintenance the setup wizard by selecting the gear icon at the top right of the screen.") \
            in result,"Start content check,test fail!"
     print "Start content check,test pass!"
Esempio n. 21
0
 def test_015_setupwizard_defalut_password(self):
     u"""网络组-默认密码"""
     log.debug("015")
     #登录路由后台取出初始配置的密码
     ssh = SSH(data_basic['DUT_ip'], data_login['all'])
     pwd_str = ssh.ssh_cmd(data_basic['sshUser'],
                           'cat /proc/gxp/dev_info/security/ssid_password')
     pwd = pwd_str.strip("\r\n")
     #使用无线网卡连接并获取到ip
     tmp = SWBusiness(self.driver)
     #取得应该的ssid
     ssid = tmp.default_ssid(data_AP['master:mac'])
     result1 = tmp.connect_WPA_AP(ssid, pwd, data_basic['wlan_pc'])
     print ssid, pwd
     assert ssid in result1, "test wifi defalut password,test fail!"
     print "test wifi defalut password,test pass!"
Esempio n. 22
0
    def test_001_factory_reset(self):
        u"""在页面上把AP恢复出厂设置(testlink_ID:773)"""
        log.debug("001")
        #如果登录没有成功,再次使用默认密码登录;如果登录成功则直接退出
        Lg = LoginBusiness(self.driver)
        Lg.login_again()

        tmp = UpgradeBusiness(self.driver)
        #描述:启用无线网卡
        tmp.wlan_enable(data_basic['wlan_pc'])
        #rsyslog服务器准备
        tmp.ready_rsyslog()
        result = tmp.web_factory_reset(data_basic['DUT_ip'],data_basic['sshUser'],\
                               data_basic['super_defalut_pwd'])
        tmp1 = SWBusiness(self.driver)
        #关闭设置向导窗口
        tmp1.close_wizard()
        #设置系统系统日志的地址
        tmp.syslog_uri()
        assert result, "reset the AP defalut config in webpage,fail!"
        print "reset the AP defalut config in webpage,pass!"
Esempio n. 23
0
 def test_002_first_login(self):
     u"""第一次登录页面需要设置管理员和用户密码"""
     log.debug("002")
     #逻辑类对象,建一个实例
     Lg = LoginBusiness(self.driver)
     #调用实例的登录GWN76xx的web界面
     Lg.login(data_basic['superUser'],data_basic["super_defalut_pwd"])
     #第一次登录页面需要设置管理员和用户密码
     Lg.set_super_user_pwd(data_login["all"],data_login["all"],\
                           data_login["all"],data_login["all"])
     ##点击下次不再显示
     tmp1 = SWBusiness(self.driver)
     tmp1.hidenexttime()
     tmp1.close_wizard()
     #检测是否登录成功
     result = Lg.login_test()
     assert result ,"login AP webpage first and set admin and user password ,test fail!"
     print "login AP webpage first and set admin and user password ,test pass!"
 def login_again(self):
     #逻辑类对象,建一个实例
     Lg = LoginBusiness(self.driver)
     if Lg.login_test() == False:
         #出厂值后登录页面需要设置管理员和用户密码
         #重新打开GWN7610的web页面
         self.driver.get(data_basic['DUT_web'])
         self.driver.implicitly_wait(10)
         #调用实例的登录GWN7610的web界面
         Lg.login(data_basic['superUser'], data_basic["super_defalut_pwd"])
         #第一次登录页面需要设置管理员和用户密码
         Lg.set_super_user_pwd(data_login["all"],data_login["all"],\
                           data_login["all"],data_login["all"])
         #关掉下次显示,并关闭设置向导
         tmp1 = SWBusiness(self.driver)
         tmp1.hidenexttime()
         tmp1.close_wizard()
         print "login AP successfully again!"
Esempio n. 25
0
 def test_037_check_version(self):
     u"""检查恢复出厂对版本的影响(testlink_ID:775)"""
     log.debug('037')
     tmp = SSH(data_basic["DUT_ip"], data_basic["super_defalut_pwd"])
     result = tmp.ssh_cmd(data_basic['sshUser'], "cat /tmp/gs_version")
     self.driver.refresh()
     self.driver.implicitly_wait(10)
     #使用新密码登录GWN7610的web界面
     tmp1 = LoginBusiness(self.driver)
     #调用实例的登录GWN76xx的web界面
     tmp1.login(data_basic['superUser'], data_basic["super_defalut_pwd"])
     #第一次登录页面需要设置管理员和用户密码
     tmp1.set_super_user_pwd(data_login["all"],data_login["all"],\
                           data_login["all"],data_login["all"])
     #关掉下次显示,并关闭设置向导
     tmp2 = SWBusiness(self.driver)
     tmp2.hidenexttime()
     tmp2.close_wizard()
     assert data_basic[
         'version'] in result, "check version after resetting,test fail!"
     print "check version after resetting,test pass!"
Esempio n. 26
0
 def test_022_setupwizard_complete(self):
     u"""complete检查(testlink_ID:1306)"""
     log.debug("022")
     tmp = SWBusiness(self.driver)
     result = tmp.complete(data_wireless['all_ssid'],
                           data_wireless['short_wpa'],
                           data_basic['wlan_pc'], data_AP['slave:mac1'],
                           data_AP['slave:mac2'])
     print result
     #测试完毕,禁用无线网卡,使pc能够上网
     tmp.dhcp_release_wlan(data_basic['wlan_pc'])
     tmp.disconnect_ap()
     tmp.wlan_disable(data_basic['wlan_pc'])
     #rsyslog服务器完成工作
     tmp.finish_rsyslog("SetupWizard")
     assert result, "complete check setupwizard,test fail!"
     print "complete check setupwizard,test pass!"