Skip to content

Commit

Permalink
Fixing imx6 recovery install timeout issue
Browse files Browse the repository at this point in the history
Description:
    Due to different platform has different install and system boot time,
    hard coding timeout to 600 is not appropriate, should support assign timeout to device system boot checking.
    howto:
        in job.yaml provide

        provision_data:
        boot_timeout: <time in second>

Resolved issues:
    Fixing imx6 recovery install timeout issue

Documentation:
    N/A
Web service API changes:
    N/A
Tests
    submit task yaml with boot_timeout and verified boot timeout can be updated

Signed-off-by: ChunAn Wu <an.wu@canonical.com>
  • Loading branch information
kiya956 committed Aug 9, 2024
1 parent 29247d8 commit b33242e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,19 @@ def copy_ssh_id(self):
def check_device_booted(self):
"""Check to see if the device is booted and reachable with ssh"""
logger.info("Checking to see if the device is available.")
try:
boot_timeout = self.job_data.get("provision_data", {}).get(
"boot_timeout", 3600
)
except AttributeError:
boot_timeout = 3600
finally:
if boot_timeout < 600:
boot_timeout = 600

started = time.time()
# Wait for provisioning to complete - can take a very long time
while time.time() - started < 3600:
while time.time() - started < boot_timeout:
try:
time.sleep(90)
if (
Expand Down
13 changes: 11 additions & 2 deletions docs/reference/device-connector-types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,22 @@ ensure that the system is reachable with ssh before proceeding to the next step.
oemrecovery
-----------

The ``oemrecovery`` device connector does not support any ``provision_data`` keys.
Instead, this device connector uses a preconfigured command to reset the device back
The ``oemrecovery`` device connector support only ``boot_timeout`` key in ``provision_data``.
This device connector uses a preconfigured command to reset the device back
to its original state. In order to ensure that the provision step is run, and the
system is reset back to the original state, you can specify any key in this dictionary
(example: ``skip: false``). If you do not want the provision step to run, you can
simply leave out the ``provision_data`` section.

.. list-table:: Supported ``provision_data`` keys for ``oemrecovery``
:header-rows: 1

* - Key
- Description
* - ``boot_timeout``
- A timeout value that wating for device recover from reset. The default timeout is
3600(s) and the minimum value should be greater than 600(s).

.. _dell_oemscript:

dell_oemscript
Expand Down

0 comments on commit b33242e

Please sign in to comment.