sanitycheck: additional scripting hook after flashing

Support custom hooks after flashing is completed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2020-01-05 22:43:52 -05:00
commit e9450065de
2 changed files with 8 additions and 0 deletions

View file

@ -27,6 +27,9 @@ sequence:
"post_script":
type: str
required: false
"post_flash_script":
type: str
required: false
"pre_script":
type: str
required: false

View file

@ -777,6 +777,7 @@ class DeviceHandler(Handler):
start_time = time.time()
pre_script = hardware.get('pre_script')
post_flash_script = hardware.get('post_flash_script')
post_script = hardware.get('post_script')
if pre_script:
@ -810,6 +811,10 @@ class DeviceHandler(Handler):
except subprocess.CalledProcessError:
os.write(write_pipe, b'x') # halt the thread
if post_flash_script:
self.run_custom_script(post_flash_script, 30)
t.join(self.timeout)
if t.is_alive():
logger.debug("Timed out while monitoring serial output on {}".format(self.instance.platform.name))