provisioning : tweak example test timeouts to reduce failures
This commit is contained in:
parent
647145a734
commit
3fe8065b7f
|
@ -53,11 +53,11 @@ def test_examples_provisioning_ble(env, extra_data):
|
||||||
dut1.start_app()
|
dut1.start_app()
|
||||||
|
|
||||||
# Parse BLE devname
|
# Parse BLE devname
|
||||||
devname = dut1.expect(re.compile(r"(?:[\s\S]*) Provisioning started with BLE devname : (PROV_\S\S\S\S\S\S)"))[0]
|
devname = dut1.expect(re.compile(r"Provisioning started with BLE devname : '(PROV_\S\S\S\S\S\S)'"), timeout=60)[0]
|
||||||
print("BLE Device Alias for DUT :", devname)
|
print("BLE Device Alias for DUT :", devname)
|
||||||
|
|
||||||
# Match additional headers sent in the request
|
# Match additional headers sent in the request
|
||||||
dut1.expect("BLE Provisioning started")
|
dut1.expect("BLE Provisioning started", timeout=30)
|
||||||
|
|
||||||
print("Starting Provisioning")
|
print("Starting Provisioning")
|
||||||
verbose = False
|
verbose = False
|
||||||
|
|
|
@ -114,7 +114,7 @@ static esp_err_t app_prov_start_service(void)
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ESP_LOGI(TAG, "Provisioning started with BLE devname : %s", config.device_name);
|
ESP_LOGI(TAG, "Provisioning started with BLE devname : '%s'", config.device_name);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,9 +54,9 @@ def test_examples_provisioning_softap(env, extra_data):
|
||||||
dut1.start_app()
|
dut1.start_app()
|
||||||
|
|
||||||
# Parse IP address of STA
|
# Parse IP address of STA
|
||||||
dut1.expect("Starting WiFi SoftAP provisioning")
|
dut1.expect("Starting WiFi SoftAP provisioning", timeout=60)
|
||||||
dut1.expect("SoftAP started")
|
dut1.expect("SoftAP started", timeout=30)
|
||||||
[ssid, password] = dut1.expect(re.compile(r"(?:[\s\S]*)SoftAP Provisioning started with SSID '(\S+)', Password '(\S+)'"))
|
[ssid, password] = dut1.expect(re.compile(r"SoftAP Provisioning started with SSID '(\S+)', Password '(\S+)'"), timeout=30)
|
||||||
|
|
||||||
iface = wifi_tools.get_wiface_name()
|
iface = wifi_tools.get_wiface_name()
|
||||||
if iface == None:
|
if iface == None:
|
||||||
|
@ -68,6 +68,9 @@ def test_examples_provisioning_softap(env, extra_data):
|
||||||
ctrl = wifi_tools.wpa_cli(iface, reset_on_exit = True)
|
ctrl = wifi_tools.wpa_cli(iface, reset_on_exit = True)
|
||||||
print("Connecting to DUT SoftAP...")
|
print("Connecting to DUT SoftAP...")
|
||||||
ip = ctrl.connect(ssid, password)
|
ip = ctrl.connect(ssid, password)
|
||||||
|
got_ip = dut1.expect(re.compile(r"softAP assign IP to station,IP is: (\d+.\d+.\d+.\d+)"), timeout=30)[0]
|
||||||
|
if ip != got_ip:
|
||||||
|
raise RuntimeError("SoftAP connected to another host! " + ip + "!=" + got_ip)
|
||||||
print("Connected to DUT SoftAP")
|
print("Connected to DUT SoftAP")
|
||||||
|
|
||||||
print("Starting Provisioning")
|
print("Starting Provisioning")
|
||||||
|
|
|
@ -126,6 +126,8 @@ class BLE_Bluez_Client:
|
||||||
break
|
break
|
||||||
|
|
||||||
if srv_path == None:
|
if srv_path == None:
|
||||||
|
self.device.Disconnect(dbus_interface='org.bluez.Device1')
|
||||||
|
self.device = None
|
||||||
raise RuntimeError("Provisioning service not found")
|
raise RuntimeError("Provisioning service not found")
|
||||||
|
|
||||||
self.characteristics = dict()
|
self.characteristics = dict()
|
||||||
|
@ -148,6 +150,7 @@ class BLE_Bluez_Client:
|
||||||
self.device.Disconnect(dbus_interface='org.bluez.Device1')
|
self.device.Disconnect(dbus_interface='org.bluez.Device1')
|
||||||
if self.adapter:
|
if self.adapter:
|
||||||
self.adapter.RemoveDevice(self.device)
|
self.adapter.RemoveDevice(self.device)
|
||||||
|
self.device = None
|
||||||
if self.adapter_props:
|
if self.adapter_props:
|
||||||
self.adapter_props.Set("org.bluez.Adapter1", "Powered", dbus.Boolean(0))
|
self.adapter_props.Set("org.bluez.Adapter1", "Powered", dbus.Boolean(0))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue