Ejemplo n.º 1
0
    def do(self):
        if local_utils.has_fastboot_serial(serial=self.serial):
            fastboot_steps.continue_to_adb(serial=self.serial, blocking=True)()

        local_steps.wait_for_adb(serial=self.serial, blocking=True)()

        adb_steps.wait_for_ui(serial=self.serial, pin=self.pin,
                              blocking=True)()

        adb_steps.command(serial=self.serial,
                          command="svc power stayon true")()

        ui_steps.remove_pin_screen_lock(serial=self.serial,
                                        pin=self.pin,
                                        blocking=True)()

        if self.set_screen_lock:
            ui_steps.set_pin_screen_lock(
                serial=self.serial,
                dut_pin=self.pin,
                require_pin_to_start_device=self.require_pin_to_start_device,
                blocking=True)()

        if self.set_wifi:
            wifi_steps.remove_network(serial=self.serial,
                                      ap_name=self.ap_name)()
            wifi_steps.connect_with_password(serial=self.serial,
                                             ap_name=self.ap_name,
                                             password=self.ap_password,
                                             blocking=True)()
        ui_steps.press_home(serial=self.serial)()
Ejemplo n.º 2
0
from testlib.scripts.android.adb import adb_steps
from testlib.scripts.android.fastboot import fastboot_steps
from testlib.scripts.android.fastboot import fastboot_utils
from testlib.scripts.connections.local import local_steps

##### initialization #####
globals().update(vars(get_args(sys.argv)))

##### test start #####
try:
	os.system("mkdir -p ./temp/files/flash")
	fastboot_utils.download_flash_scripts()

	adb_steps.reboot(command="fastboot", reboot_timeout=300, serial=serial)()
	local_steps.wait_for_fastboot(timeout=300, serial=serial)()
	fastboot_steps.continue_to_adb(serial=serial)()
	local_steps.wait_for_adb(timeout=300, serial=serial)()

	os.system("adb -s {0} shell reboot -p".format(serial))
	time.sleep(30)
	fastboot_utils.to_fastboot_by_script(serial=serial)
	local_steps.wait_for_fastboot(timeout=300, serial=serial)()
	fastboot_steps.continue_to_adb(serial=serial)()
	local_steps.wait_for_adb(timeout=300, serial=serial)()
	os.system("sudo rm -rf ./temp")

except:
	fastboot_utils.to_fastboot_by_script(serial=serial)
	local_steps.wait_for_fastboot(timeout=300, serial=serial)()
	fastboot_steps.continue_to_adb(serial=serial)()
	local_steps.wait_for_adb(timeout=300, serial=serial)()