How to use _set_bootloader method in autotest

Best Python code snippet using autotest_python

arm.py

Source:arm.py Github

copy

Full Screen

...64 self.uefi_entry = uefi_entry65 self.ready_timeout = ready_timeout66 self.bootloader = None67 self.hard_reset_method = None68 self._set_bootloader(bootloader)69 self._set_hard_reset_method(hard_reset_method)70 self._set_flash_method(flash_method)71 def init_target_connection(self, target):72 if target.os == 'android':73 self._init_android_target(target)74 else:75 self._init_linux_target(target)76 def _init_android_target(self, target):77 if target.connection_settings.get('device') is None:78 addr = self._get_target_ip_address(target)79 target.connection_settings['device'] = addr + ':5555'80 def _init_linux_target(self, target):81 if target.connection_settings.get('host') is None:82 addr = self._get_target_ip_address(target)83 target.connection_settings['host'] = addr84 def _get_target_ip_address(self, target):85 with open_serial_connection(port=self.serial_port,86 baudrate=self.baudrate,87 timeout=30,88 init_dtr=0) as tty:89 tty.sendline('')90 self.logger.debug('Waiting for the Android shell prompt.')91 tty.expect(target.shell_prompt)92 self.logger.debug('Waiting for IP address...')93 wait_start_time = time.time()94 while True:95 tty.sendline('ip addr list eth0')96 time.sleep(1)97 try:98 tty.expect(r'inet ([1-9]\d*.\d+.\d+.\d+)', timeout=10)99 return tty.match.group(1)100 except pexpect.TIMEOUT:101 pass # We have our own timeout -- see below.102 if (time.time() - wait_start_time) > self.ready_timeout:103 raise TargetError('Could not acquire IP address.')104 def _set_hard_reset_method(self, hard_reset_method):105 if hard_reset_method == 'dtr':106 self.modules.append({'vexpress-dtr': {'port': self.serial_port,107 'baudrate': self.baudrate,108 }})109 elif hard_reset_method == 'reboottxt':110 self.modules.append({'vexpress-reboottxt': {'port': self.serial_port,111 'baudrate': self.baudrate,112 'path': self.vemsd_mount,113 }})114 else:115 ValueError('Invalid hard_reset_method: {}'.format(hard_reset_method))116 def _set_bootloader(self, bootloader):117 self.bootloader = bootloader118 if self.bootloader == 'uefi':119 self.modules.append({'vexpress-uefi': {'port': self.serial_port,120 'baudrate': self.baudrate,121 'image': self.image,122 'fdt': self.fdt,123 'initrd': self.initrd,124 'bootargs': self.bootargs,125 }})126 elif self.bootloader == 'uefi-shell':127 self.modules.append({'vexpress-uefi-shell': {'port': self.serial_port,128 'baudrate': self.baudrate,129 'image': self.image,130 'bootargs': self.bootargs,...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful