[Fuchsia] Log failure to create Policy controller
Adds a log line when failing to create a Policy controller, as seen in
https://fxbug.dev/97316
Bug: None
Test: local run of `WlanSecurityComplianceABGTest` with intentional err
Change-Id: I8e773486ebb19e7a68eb173e900e08d5e0e61bd7
diff --git a/acts/framework/acts/controllers/fuchsia_lib/lib_controllers/wlan_policy_controller.py b/acts/framework/acts/controllers/fuchsia_lib/lib_controllers/wlan_policy_controller.py
index e5b8fce..53c5839 100644
--- a/acts/framework/acts/controllers/fuchsia_lib/lib_controllers/wlan_policy_controller.py
+++ b/acts/framework/acts/controllers/fuchsia_lib/lib_controllers/wlan_policy_controller.py
@@ -85,10 +85,12 @@
self.log.debug(f"Paused session: {response.get('result')}")
# Acquire control of policy layer
+ controller_errors = []
while time.time() < end_time:
# Create a client controller
response = self.device.wlan_policy_lib.wlanCreateClientController()
if response.get('error'):
+ controller_errors.append(response['error'])
self.log.debug(response['error'])
time.sleep(1)
continue
@@ -96,11 +98,15 @@
# channel, meaning the client controller was rejected.
response = self.device.wlan_policy_lib.wlanGetSavedNetworks()
if response.get('error'):
+ controller_errors.append(response['error'])
self.log.debug(response['error'])
time.sleep(1)
continue
break
else:
+ self.log.warning(
+ "Failed to create and use a WLAN policy client controller. Errors: ["
+ + "; ".join(controller_errors) + "]")
raise WlanPolicyControllerError(
'Failed to create and use a WLAN policy client controller.')