def check_time_zone(self): tmp = UpgradeBusiness(self.driver) result = [] fail_info = [] #点击系统设置 tmp.System_menu() #点击基本菜单 tmp.Basic_menu() timezone_list = data_timezone['timezone_list'] timezone_str = data_timezone['timezone_str'] for i in range(len(timezone_list)): #选择设置不同的时区 BasicControl.set_time_zone(self, timezone_list[i]) tmp.save() tmp.apply() print "change timezone: %s successfully!" % timezone_list[i] #登录AP后台判断字符串是否正确 ssh = SSH(data_basic['DUT_ip'], data_login["all"]) result1 = ssh.ssh_cmd(data_basic['sshUser'], "date -R") if timezone_str[i] in result1: result.append(True) else: timezone_fail_info = "%s\t\t\t%s\t\t\t%s" % ( timezone_list[i], result1, timezone_str[i]) fail_info.append(timezone_fail_info) result.append(False) #如果有fail信息,则打印 if fail_info != []: print "timezone\t\t\ttest result\t\t\tcorrect result" fail_info_str = "\n".join(fail_info) print fail_info_str return result
def set_country(self, country_code): #点击系统设置菜单 tmp = UpgradeBusiness(self.driver) tmp.System_menu() #选择当前的国家代码 BasicControl.set_country_code(self, country_code) #点击保存 tmp.save() tmp.apply() time.sleep(80)
def change_user_pwd(self, user_pwd1, user_pwd2): tmp = UpgradeBusiness(self.driver) #点击系统设置菜单 tmp.System_menu() #点击访问菜单 tmp.Access_menu() #输入用户新密码 AccessControl.set_userpass1(self, user_pwd1) #输入确认用户新密码 AccessControl.set_userpass2(self, user_pwd2) #点击保存 tmp.save()
def change_admin_pwd(self, current_pwd, admin_pwd1, admin_pwd2): tmp = UpgradeBusiness(self.driver) #点击系统设置菜单 tmp.System_menu() #点击访问菜单 tmp.Access_menu() #输入当前管理员密码 AccessControl.set_pass0(self, current_pwd) #输入管理员新密码 AccessControl.set_pass1(self, admin_pwd1) #输入确认管理员新密码 AccessControl.set_pass2(self, admin_pwd2) #点击保存 tmp.save()