mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-10-31 15:12:25 +00:00 
			
		
		
		
	framework/execution: Implement reboot policies
Although the configuration of reboot policies was present the actual implementation was missing.
This commit is contained in:
		| @@ -78,8 +78,8 @@ class RebootPolicy(object): | ||||
|         return self.policy != 'never' | ||||
|  | ||||
|     @property | ||||
|     def perform_initial_boot(self): | ||||
|         return self.policy not in ['never', 'as_needed'] | ||||
|     def perform_initial_reboot(self): | ||||
|         return self.policy == 'initial' | ||||
|  | ||||
|     @property | ||||
|     def reboot_on_each_job(self): | ||||
|   | ||||
| @@ -327,6 +327,9 @@ class Executor(object): | ||||
|         self.target_manager = TargetManager(config.run_config.device, | ||||
|                                        config.run_config.device_config, | ||||
|                                        output.basepath) | ||||
|  | ||||
|         if config_manager.run_config.reboot_policy.perform_initial_reboot: | ||||
|             self.target_manager.target.reboot() | ||||
|         output.set_target_info(self.target_manager.get_target_info()) | ||||
|  | ||||
|         self.logger.info('Initializing execution context') | ||||
| @@ -461,6 +464,10 @@ class Runner(object): | ||||
|         signal.disconnect(self._warning_signalled_callback, signal.WARNING_LOGGED) | ||||
|  | ||||
|     def run_next_job(self, context): | ||||
|         if self.config.run_config.reboot_policy.reboot_on_each_job: | ||||
|             self.logger.debug('Rebooting on new job.') | ||||
|             self.context.tm.target.reboot() | ||||
|  | ||||
|         job = context.start_job() | ||||
|         self.logger.info('Running job {}'.format(job.id)) | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user