mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-06-22 00:05:54 +01:00
Fixing reboot on Linux devices [part 2]
- connect() to device before issuing the initial reboot, as soft reset requires a device connection. - boot() has been implemented to wait properly for the device to reboot after reset. - port now defaults to 22 rather than being left unset, as need something to connect to when polling for device after reboot. - Only use -P option for scp when port is *not* 22; as that option appears to cause intermittent issues with default scp on Ubuntu 12.04
This commit is contained in:
wlauto
@ -511,13 +511,7 @@ class Runner(object):
|
||||
|
||||
def _initialize_run(self):
|
||||
self.context.run_info.start_time = datetime.utcnow()
|
||||
if self.context.reboot_policy.perform_initial_boot:
|
||||
self.logger.info('\tBooting device')
|
||||
with self._signal_wrap('INITIAL_BOOT'):
|
||||
self._reboot_device()
|
||||
else:
|
||||
self.logger.info('Connecting to device')
|
||||
self.device.connect()
|
||||
self._connect_to_device()
|
||||
self.logger.info('Initializing device')
|
||||
self.device.initialize(self.context)
|
||||
|
||||
@ -529,6 +523,24 @@ class Runner(object):
|
||||
if instrumentation.check_failures():
|
||||
raise InstrumentError('Detected failure(s) during instrumentation initialization.')
|
||||
|
||||
def _connect_to_device(self):
|
||||
if self.context.reboot_policy.perform_initial_boot:
|
||||
try:
|
||||
self.device.connect()
|
||||
except DeviceError: # device may be offline
|
||||
if self.device.can('reset_power'):
|
||||
self.device.hard_reset()
|
||||
else:
|
||||
raise DeviceError('Cannot connect to device for initial reboot; '
|
||||
'and device does not support hard reset.')
|
||||
else: # successfully connected
|
||||
self.logger.info('\tBooting device')
|
||||
with self._signal_wrap('INITIAL_BOOT'):
|
||||
self._reboot_device()
|
||||
else:
|
||||
self.logger.info('Connecting to device')
|
||||
self.device.connect()
|
||||
|
||||
def _init_job(self):
|
||||
self.current_job.result.status = IterationResult.RUNNING
|
||||
self.context.next_job(self.current_job)
|
||||
|
Reference in New Issue
Block a user