Beispiel #1
0
def step_100msh0071(self):
    try:
        result = []
        #取出测试所需的dns地址
        for dns in data.wan_dns():
            #修改DNS
            wan_control.set_wan_staticip_dns(self,dns)
            #点击保存应用
            wan_control.apply(self)
            time.sleep(60)
            #登录ssh ping 外网
            m = wan_network_control.router_access_internet()
            #把结果加入result列表
            result.append(m)
            #使用默认ip登录wan页面
            goin_default_wan(self)
        return result
    #捕捉异常并打印异常信息
    except Exception,e:
        print u"修改wan广播地址过程失败,原因如下:\n%s"%e
Beispiel #2
0
def change_staticip(self,ip,gw,dns):
    try:
        driver = self.driver
        #协议选择staticip
        wan_control.set_wan_protrocol(self,'staticip')
        #点击切换协议
        wan_control.set_wan_switchprotocol(self)
        driver.implicitly_wait(10)
        #输入wan ip
        wan_control.set_wan_staticip_ip(self,ip)
        #选择C类掩码
        wan_control.set_wan_staticip_netmask(self,'C')
        #输入wan 网关
        wan_control.set_wan_staticip_gateway(self,gw)
        #输入DNS
        wan_control.set_wan_staticip_dns(self,dns)
        wan_control.apply(self)
        time.sleep(60)
    #捕捉异常并打印异常信息
    except Exception,e:
        print u"把路由WAN口改为static ip的过程失败,原因如下:\n%s"%e