def step_100msh0072(self): try: #获取路由wan口默认mac default_mac = wan_control.get_wan_mac(self) #获取PC的mac pc_mac = public_control.get_localmac() #mac字母改为大写 PC_MAC = pc_mac.upper() #修改路由WAN口mac为pc的mac地址 change_mac(self,PC_MAC) time.sleep(60) mac = wan_network_control.router_wan_inet() if PC_MAC in mac: result = 1 else: result = 0 #使用默认ip登录wan页面 goin_default_wan(self) #测试完成后修改回默认的mac地址 change_mac(self,default_mac) return result #捕捉异常并打印异常信息 except Exception,e: print u"wan MAC地址克隆过程失败,原因如下:\n%s"%e
def step_100msh0070(self): try: result = [] #取出测试所需的广播地址 for broadcast in data.wan_broadcast(): #修改广播地址 wan_control.set_wan_staticip_broadcast(self,broadcast) #点击保存应用 wan_control.apply(self) time.sleep(60) #登录ssh输入ifconfig m = wan_network_control.router_wan_inet() #如果广播地址正确,把数字1传给result,否则传数字0 if broadcast in m: result.append(1) else: result.append(0) #使用默认ip登录wan页面 goin_default_wan(self) return result #捕捉异常并打印异常信息 except Exception,e: print u"修改wan广播地址过程失败,原因如下:\n%s"%e