From 9fdc5f347b6328693bd5d3048e566e9c9b8b4d57 Mon Sep 17 00:00:00 2001 From: enriquezgarc Date: Wed, 19 Jul 2023 18:32:02 +0200 Subject: [PATCH] tests/psoc6/multi/network_config.py: Added network config multi test. Signed-off-by: enriquezgarc --- tests/psoc6/multi/network_config.py | 20 ++++++++++---------- tests/psoc6/multi/network_config.py.exp | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 tests/psoc6/multi/network_config.py.exp diff --git a/tests/psoc6/multi/network_config.py b/tests/psoc6/multi/network_config.py index 897837c0d9e72..4cc802dfcafd3 100644 --- a/tests/psoc6/multi/network_config.py +++ b/tests/psoc6/multi/network_config.py @@ -3,7 +3,7 @@ channel_new = 5 ssid_new = "mpy-test-conf-wlan" pass_new = "alicessecret" -sec_new = network.WPA3 +sec_new = network.WLAN.WPA2 # Access Point @@ -14,13 +14,16 @@ def instance0(): # ifconfig() # get config() - print("ap config get channel: ", ap_if.config("channel") == channel_new) ap_if.config(channel=channel_new) - print("ap config get ssid: ", ap_if.config("ssid") == ssid_new) + print("ap config get channel: ", ap_if.config("channel") == channel_new) ap_if.config(ssid=ssid_new) - print("ap config get pass: ", ap_if.config("key") == pass_new) + print("ap config get ssid: ", ap_if.config("ssid") == ssid_new) + ap_if.config(security=sec_new, key=pass_new) print("ap config get security: ", ap_if.config("security") == sec_new) - ap_if.config(sec=ssid_new, key=pass_new) + try: + ap_if.config("password") # only if default + except ValueError as err: + print(err) # active() ap_if.active(True) @@ -63,9 +66,6 @@ def instance1(): try: sta_if.config("key") # not for STA except ValueError as err: - print("network config key not for sta: ", err) + print(err) - # print(" > yield access point") - # multitest.next() - - # ifconfig() + # # ifconfig() diff --git a/tests/psoc6/multi/network_config.py.exp b/tests/psoc6/multi/network_config.py.exp new file mode 100644 index 0000000000000..672ec48f4fab2 --- /dev/null +++ b/tests/psoc6/multi/network_config.py.exp @@ -0,0 +1,19 @@ +--- instance0 --- +ap instance created +ap config get channel: True +ap config get ssid: True +ap config get security: True +network conf password only queryable for default password +ap is activated + > yield station +ap has clients: True +ap status has stations: True +--- instance1 --- +sta instance created +sta attempt connection to ap +sta is (now) active: True +sta is (now) connected: True +sta assoc ap channel config: True +sta assoc ap ssid config: True +sta assoc ap security config: True +network access point required