Skip to content

Commit

Permalink
Merge pull request #267 from canonical/enhance-sdwire-reboot
Browse files Browse the repository at this point in the history
Fix sdwire detection issue
  • Loading branch information
nancyc12 authored May 3, 2024
2 parents a6c8def + 9c68cad commit 9eeddf4
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,10 @@ def _copy_to_control(self, local_file, remote_file):
raise ProvisioningError(e.output)
return output

def reboot_control_host(self):
def reboot_sdwire(self):
"""
Reboot the control host
Sometimes the control host can end up in an unstable condition which
isn't easy to detect until it's too late. Since nothing else should
be using the control host, check and power cycle it if needed before
provisioning to ensure it's in a known good state.
Reboot both control host and DUT to ensure SDwire be in a good state
before provisioning.
"""
if not self.config.get("control_host_reboot_script"):
logger.warning(
Expand All @@ -148,6 +145,9 @@ def reboot_control_host(self):
except Exception:
raise ProvisioningError("fail to reboot control host")

logger.info("Rebooting DUT")
self.hardreset()

reboot_timeout = self.config.get("control_host_reboot_timeout", 120)
time.sleep(reboot_timeout)
# It should be up after 120s, but wait for another cycle if necessary
Expand Down Expand Up @@ -214,7 +214,7 @@ def provision(self):

# If this is not a zapper, reboot before provisioning
if "zapper" not in self.config.get("control_switch_local_cmd", ""):
self.reboot_control_host()
self.reboot_sdwire()
time.sleep(5)

self.flash_test_image(source)
Expand Down

0 comments on commit 9eeddf4

Please sign in to comment.