From afec1cd2e9d3b7fa1d1e08c985edd9d819ab3439 Mon Sep 17 00:00:00 2001 From: nancyc12 Date: Thu, 2 May 2024 18:46:39 +0800 Subject: [PATCH 1/2] fix sdwire detection issue --- .../devices/muxpi/muxpi.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/device-connectors/src/testflinger_device_connectors/devices/muxpi/muxpi.py b/device-connectors/src/testflinger_device_connectors/devices/muxpi/muxpi.py index 46f395b5..984f3c0b 100644 --- a/device-connectors/src/testflinger_device_connectors/devices/muxpi/muxpi.py +++ b/device-connectors/src/testflinger_device_connectors/devices/muxpi/muxpi.py @@ -113,13 +113,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( @@ -135,6 +132,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 @@ -151,7 +151,7 @@ def reboot_control_host(self): 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() try: url = self.job_data["provision_data"]["url"] except KeyError: From 9c68cad9e606ff0baf619d509e212c0995483ca1 Mon Sep 17 00:00:00 2001 From: nancyc12 Date: Fri, 3 May 2024 23:53:43 +0800 Subject: [PATCH 2/2] update to resolve conflict --- .../testflinger_device_connectors/devices/muxpi/muxpi.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/device-connectors/src/testflinger_device_connectors/devices/muxpi/muxpi.py b/device-connectors/src/testflinger_device_connectors/devices/muxpi/muxpi.py index 741b3a39..412203a5 100644 --- a/device-connectors/src/testflinger_device_connectors/devices/muxpi/muxpi.py +++ b/device-connectors/src/testflinger_device_connectors/devices/muxpi/muxpi.py @@ -162,10 +162,6 @@ def reboot_sdwire(self): self._run_control("true") 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_sdwire() - # determine where to get the provisioning image from source = self.job_data["provision_data"].get("url") if source is None: @@ -218,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)