def do(self): after_wipe_prepare_device(serial=self.serial, db_prop_list=self.db_prop_list, env_prop_list=self.env_prop_list)() adb_steps.reboot(serial=self.serial)() time.sleep(10) local_steps.wait_for_ping(blocking=True, timeout=100, ip=self.ip)() after_wipe_prepare_ui(serial=self.serial)()
def do(self): if not local_steps.wait_for_ping(timeout=30, ip=self.ssh_host): self.set_errorm("", "AP did not respond to ping") return False commands = ddwrt_utils.generate_ap_config_atheros( self.mode, self.security, encryption=self.encryption, wifi_password=self.wifi_password, radius_ip=self.radius_ip, radius_secret=self.radius_secret, hidden_ssid=self.hidden_ssid, new_ssid=self.new_ssid, channel_bw=self.channel_bw, channel_no=self.channel_no, interface5ghz=self.interface5ghz, ipv6_enable=self.ipv6_enable, radvd_enable=self.radvd_enable, dhcp_lease=self.dhcp_lease) for command_group in ddwrt_utils.split_config(commands): local_steps.ssh_command(command=command_group, ssh_host=self.ssh_host, ssh_user=self.ssh_user, ssh_pass=self.ssh_pwd)()
def do(self): if not local_steps.wait_for_ping(timeout=30, ip=self.ssh_host): self.set_errorm("", "AP did not respond to ping") return False # Copy the radvd conf file to the ap local_steps.scp_command(local=self.radvd_conf_file, remote=self.remote_file, ssh_host=self.ssh_host, ssh_user=self.ssh_user)() #kill if the process is running & restart with new radvd config kill_command = "killall radvd - C / tmp / radvd.conf" self.step_data = local_steps.ssh_command(command=kill_command, ssh_host=self.ssh_host, ssh_user=self.ssh_user)() # Enable the radvd daemon and check if the process is running command = "radvd -C {0}".format(self.remote_file) self.step_data = local_steps.ssh_command( command=command, ssh_host=self.ssh_host, ssh_user=self.ssh_user, check_command="ps | grep radvd", check_command_output=command)()
def do(self): ssh_steps.command(blocking=True, command="repair -wR", timeout=600, host=self.ip, user="******", password="", sftp_enabled=False)() ssh_steps.command(blocking=True, command="reboot", timeout=200, host=self.ip, user="******", password="", sftp_enabled=False)() time.sleep(10) local_steps.wait_for_ping(blocking=True, timeout=100, ip=self.ip)()
def do(self): if not local_steps.wait_for_ping(timeout=30, ip=self.ssh_host): self.set_errorm("", "AP did not respond to ping") return False command = "ip addr add {0} dev br0".format(self.ipv6_ip) self.step_data = local_steps.ssh_command( command=command, ssh_host=self.ssh_host, ssh_user=self.ssh_user, check_command="ifconfig br0 | grep inet6", check_command_output=self.ipv6_ip)
def do(self): if not local_steps.wait_for_ping(timeout=30, ip=self.ssh_host): self.set_errorm("", "AP did not respond to ping") return False commands = ddwrt_utils.generate_virtap_config_atheros( self.enable, self.security, self.encryption, self.wifi_password, self.radius_ip, self.radius_secret, self.hidden_ssid, self.new_ssid, self.interface5ghz) for command_group in ddwrt_utils.split_config(commands): local_steps.ssh_command(command=command_group, ssh_host=self.ssh_host, ssh_user=self.ssh_user, ssh_pass=self.ssh_pwd)()
def check_condition(self): #wait until AP starts restarting services (and stops responding to ping) waiting = 0 timeout = 30 while waiting < timeout: if not self.local_connection.check_ping(self.ssh_host): break else: time.sleep(2) waiting += 2 else: self.set_errorm("", "AP did not stop running") #return False #wait until AP finishes the reboot self.set_errorm("", "AP started restarting services") return local_steps.wait_for_ping(timeout=35, ip=self.ssh_host)
from testlib.scripts.connections.ssh import ssh_steps from testlib.scripts.connections.local import local_steps from testlib.scripts.android.adb import adb_steps import sys import time adb_steps.connect_device(serial=sys.argv[1] + ":5555", port=sys.argv[2])() adb_steps.reboot(command="recovery", reboot_timeout=200, blocking=True)() ssh_steps.command(command="ls /usr/bin/sp_update", stdout_grep="/usr/bin/sp_update", stdout_not_grep="No such file or directory", host=sys.argv[1], user="******", password="", verbose=True, sftp_enabled=False)() ssh_steps.command(command="reboot", timeout=200, host=sys.argv[1], user="******", password="", sftp_enabled=False)() time.sleep(10) local_steps.wait_for_ping(timeout=100, ip=sys.argv[1])()
value="wpa2_psk", ssh_host=ddwrt_ip, ssh_user=ddwrt_user, ssh_pwd=ddwrt_pwd, media_path=ddwrt_script_path, blocking=True)() local_steps.ssh_command(command="reboot", ssh_host=ddwrt_ip, ssh_user=ddwrt_user, ssh_pass=ddwrt_pwd, blocking=True)() time.sleep(30) local_steps.wait_for_ping(ip=ddwrt_ip, blocking=True)() wifi_steps.set_from_wifi_settings()() time.sleep(30) ap_list = [ ddwrt_ap_name, ] wifi_steps.check_AP_list_is_scanned(ap_list=ap_list, blocking=True)() if wifi_utils.is_known_AP(ddwrt_ap_name): wifi_steps.forget_wifi_network(ap_name=ddwrt_ap_name)() time.sleep(20)