def reset_button(): try: lpa.ac_off(soundwave_port) time.sleep(5) lpa.ac_on(soundwave_port) time.sleep(os_boot_timeout) return True except Exception: return False
def test_flash_ifwi(image_for_flash, port='COM101', step_string="Flash the latest BIOS and boot to setup menu", complete=True): os_state = is_boot_state() if os_state == "windows": wh.wmi_os_opt(local=False, os_instruct="shutdown") try: lfs.flashifwi_em100(binfile=image_for_flash, soundwave_port=port) lpa.ac_on(port) time.sleep(20) log_write('INFO', "IFWI flashed successfully with: %s" % image_for_flash) except Exception: result_process(False, step_string, test_exit=True, is_step_complete=complete) enter_bios = bios_conf.enter_bios(boot_wait_timeout, f2_timeout) result_process(enter_bios, step_string, test_exit=True, is_step_complete=complete)
def bios_init_opr(): sut_state = is_boot_state() log_write('INFO', 'SUT is under %s state' % sut_state) if sut_state == 'bios': return True elif "efi" in sut_state: bios_conf.bios_control_key_press('CTRL_ALT_DELETE') enter_bios = bios_conf.enter_bios(boot_wait_timeout, f2_timeout) return enter_bios elif sut_state == 'windows': try: wh.wmi_os_opt(local=False, os_instruct="reboot") enter_bios = bios_conf.enter_bios(boot_wait_timeout, f2_timeout) return enter_bios except Exception: return False else: lpa.ac_off(soundwave_port) time.sleep(5) lpa.ac_on(soundwave_port) enter_bios = bios_conf.enter_bios(boot_wait_timeout, f2_timeout) return enter_bios