Exemplo n.º 1
0
def step_100msh0088(self):
    try:
        result = []
        i = 0
        #PPPoE错误和正确用户名交替使用3次
        while(i<3):
            #取出正确的和错误的用户名和密码
            id_passwd = data.pppoe_id_passwd()
            err_id_passwd = data.pppoe_err_id_passwd()
            #登录默认ip下路由器的wan设置页面
            goin_default_wan(self)
            #改变pppoe的用户名和密码
            change_pppoe_id_passwd(self,err_id_passwd[0],err_id_passwd[1])
            #路由能否访问网络,错误的用户名和密码应该不能访问网络,返回False
            result_err = wan_network_control.router_access_internet()
            result.append(result_err)
            #登录默认ip下路由器的wan设置页面
            goin_default_wan(self)
            #改变pppoe的用户名和密码
            change_pppoe_id_passwd(self,id_passwd[0],id_passwd[1])
            #路由能否访问网络,正确的用户名和密码应该不能访问网络,返回True
            result_correct = wan_network_control.router_access_internet()
            result.append(result_correct)
            assert result_err == False and result_correct == True,\
                u"第'%s'次错误和正常账号密码交替输入出现错误,无法进行下一步"%(i+1)
            i +=1
        return result
    #捕捉异常并打印异常信息
    except Exception,e:
        print u"错误和正常账号密码交替输入的过程失败,原因如下:\n%s"%e
Exemplo n.º 2
0
def step_100msh0074(self):
    try:
        result = []
        #切换协议为dhcp
        change_dhcp(self)
        #路由能否访问网络
        ping = wan_network_control.router_access_internet()
        result.append(ping)
        #路由wifidog进程是否存在
        wifidog = wan_network_control.ssh_wifidog()
        result.append(wifidog)
        return result
    #捕捉异常并打印异常信息
    except Exception,e:
        print u"把路由WAN口改为DHCP的过程失败,原因如下:\n%s"%e
Exemplo n.º 3
0
def step_100msh0083(self):
    try:
        result = []
        id_passwd = data.pppoe_id_passwd()
        #切换协议为pppoe
        change_pppoe(self,id_passwd[0],id_passwd[1])
        #路由能否访问网络
        ping = wan_network_control.router_access_internet()
        result.append(ping)
        #路由wifidog进程是否存在
        wifidog = wan_network_control.ssh_wifidog()
        result.append(wifidog)
        return result
    #捕捉异常并打印异常信息
    except Exception,e:
        print u"把路由WAN口改为PPPOE的过程失败,原因如下:\n%s"%e
Exemplo n.º 4
0
def step_100msh0069(self):
    try:
        result = []
        d = data.wan_staticip_data()
        #协议切换成static ip
        change_staticip(self,d[0],d[1],d[2])
        #路由能否访问网络
        ping = wan_network_control.router_access_internet()
        result.append(ping)
        #路由wifidog进程是否存在
        wifidog = wan_network_control.ssh_wifidog()
        result.append(wifidog)
        return result
    #捕捉异常并打印异常信息
    except Exception,e:
        print u"WAN设置为静态IP地址过程失败,原因如下:\n%s"%e
Exemplo n.º 5
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