Beispiel #1
0
def step_100msh0075(self):
    try:
        wan_network_control.reboot_router()
        time.sleep(10)
        ping = wan_network_control.get_ping('www.baidu.com')
        if ping != 0:
            #client点击连接网络上网
            network_control.redirect(self,"http://www.haosou.com/")
            time.sleep(10)
        #client ping外网返回结果
        result = wan_network_control.get_ping('www.baidu.com')
        return result
    #捕捉异常并打印异常信息
    except Exception,e:
        print u"重启/重新上电后上网的过程失败,原因如下:\n%s"%e
Beispiel #2
0
def redirect_get_js(self):
    url1 = "http://www.qq.com"
    result = network_control.redirect(self,url1)
    assert result==True,u"通过访问%s网页认证不成功,无法进行下一步"%url1
    result2 = network_control.network(self,"http://www.sina.com.cn","新浪")
    assert result2==True,u"认证后网页访问失败,无法进行下一步"
    time.sleep(10)
    data = privoxy_control.get_js(self)
    return data
Beispiel #3
0
def step_100msh0073_1(self):
    try:
        result = []
        a = wan_network_control.get_ping('www.baidu.com')
        if a != 0:
            #client点击连接网络上网
            network_control.redirect(self,"http://www.haosou.com/")
            time.sleep(10)
        #测试默认mtu值(1500),client端ping数据包大小(减28个字节)来判断MTU值的有效性
        ping1 = wan_network_control.get_mtu('1472')
        ping2 = wan_network_control.get_mtu('1473')
        #print ping1,ping2
        if ping1 == 0 and ping2 != 0:
            result.append(1)
        else:
            result.append(0)

        #使用正确的mtu值测试,并验证有效性
        mtu,mtu_low,mtu_up = data.wan_mtu()
        i = 0
        while(i<2):
            time.sleep(10)
            #修改mtu值
            change_mtu(self,mtu[i])
            time.sleep(10)
            b = wan_network_control.get_ping('www.baidu.com')
            if b != 0:
                #client点击连接网络上网
                network_control.redirect(self,"http://www.haosou.com/")
                time.sleep(10)
            #client端ping数据包大小(减28个字节)来判断MTU值的有效性
            ping3 = wan_network_control.get_mtu(mtu_low[i])
            ping4 = wan_network_control.get_mtu(mtu_up[i])
            #print ping3,ping4
            if ping3 == 0 and ping4 != 0:
                result.append(1)
            else:
                result.append(0)
            i +=1
        return result
    #捕捉异常并打印异常信息
    except Exception,e:
        print u"设置正确的mtu值的过程失败,原因如下:\n%s"%e
Beispiel #4
0
def step_100msh0076(self):
    try:
        ping = wan_network_control.get_ping('www.baidu.com')
        if ping != 0:
            #client点击连接网络上网
            network_control.redirect(self,"http://www.haosou.com/")
            time.sleep(10)
        #使用默认ip登录接口页面
        interface_business.goin_default_interface(self)
        i = 0
        #点击WAN口关闭/连接10次
        while(i<11):
            #点击接口页面中wan的关闭/连接
            wan_disconnect_connect(self)
            time.sleep(10)
            assert ping == 0,u"第'%s'次关闭/连接wan口,client不能够上网,无法进行下一步"%(i+1)
            i +=1
        return ping
    #捕捉异常并打印异常信息
    except Exception,e:
        print u"WAN口反复关闭的过程失败,原因如下:\n%s"%e