ci provisioning: Add some experiments to check the runner's STA state
Not clear why sometimes it associates without negotiating a new DHCP lease.
This commit is contained in:
parent
e0fc7b1c48
commit
d7f251aef3
|
@ -51,6 +51,7 @@ def test_examples_provisioning_softap(env, extra_data):
|
||||||
print("SoftAP SSID : " + ssid)
|
print("SoftAP SSID : " + ssid)
|
||||||
print("SoftAP Password : " + password)
|
print("SoftAP Password : " + password)
|
||||||
|
|
||||||
|
try:
|
||||||
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)
|
||||||
|
@ -97,6 +98,8 @@ def test_examples_provisioning_softap(env, extra_data):
|
||||||
|
|
||||||
if not esp_prov.wait_wifi_connected(transport, security):
|
if not esp_prov.wait_wifi_connected(transport, security):
|
||||||
raise RuntimeError("Provisioning failed")
|
raise RuntimeError("Provisioning failed")
|
||||||
|
finally:
|
||||||
|
ctrl.reset()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -55,8 +55,9 @@ class wpa_cli:
|
||||||
if self.iface_ifc is None:
|
if self.iface_ifc is None:
|
||||||
raise RuntimeError('supplicant : Failed to fetch interface')
|
raise RuntimeError('supplicant : Failed to fetch interface')
|
||||||
|
|
||||||
self.old_network = self.iface_obj.Get("fi.w1.wpa_supplicant1.Interface", "CurrentNetwork",
|
self.old_network = self._get_iface_property("CurrentNetwork")
|
||||||
dbus_interface='org.freedesktop.DBus.Properties')
|
print("Old network is %s" % self.old_network)
|
||||||
|
|
||||||
if self.old_network == '/':
|
if self.old_network == '/':
|
||||||
self.old_network = None
|
self.old_network = None
|
||||||
else:
|
else:
|
||||||
|
@ -78,6 +79,8 @@ class wpa_cli:
|
||||||
if self.new_network is not None:
|
if self.new_network is not None:
|
||||||
self.iface_ifc.RemoveNetwork(self.new_network)
|
self.iface_ifc.RemoveNetwork(self.new_network)
|
||||||
|
|
||||||
|
print("Pre-connect state is %s, IP is %s" % (self._get_iface_property("State"), get_wiface_IPv4(self.iface_name)))
|
||||||
|
|
||||||
self.new_network = self.iface_ifc.AddNetwork({"ssid": ssid, "psk": password})
|
self.new_network = self.iface_ifc.AddNetwork({"ssid": ssid, "psk": password})
|
||||||
self.iface_ifc.SelectNetwork(self.new_network)
|
self.iface_ifc.SelectNetwork(self.new_network)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue