[ACTS][NetworkSuggestion] add test for hidden network
When an App suggested a hidden network, will add to scan list, and
connect to it if selected by network selector.
Bug: 138975620
Test: acts WifiNetworkSuggestionTest
Change-Id: I41352fdc84c328073f7e550d39f4f53e563ee316
diff --git a/acts/tests/google/wifi/WifiNetworkSuggestionTest.py b/acts/tests/google/wifi/WifiNetworkSuggestionTest.py
index 27f859c..275dee5 100755
--- a/acts/tests/google/wifi/WifiNetworkSuggestionTest.py
+++ b/acts/tests/google/wifi/WifiNetworkSuggestionTest.py
@@ -60,7 +60,7 @@
req_params = []
opt_param = [
"open_network", "reference_networks", "radius_conf_2g", "radius_conf_5g", "ca_cert",
- "eap_identity", "eap_password"
+ "eap_identity", "eap_password", "hidden_networks"
]
self.unpack_userparams(
req_param_names=req_params, opt_param_names=opt_param)
@@ -95,6 +95,8 @@
Ent.PHASE2: int(EapPhase2.MSCHAPV2),
WifiEnums.SSID_KEY: self.ent_network_2g[WifiEnums.SSID_KEY],
}
+ if hasattr(self, "hidden_networks"):
+ self.hidden_network = self.hidden_networks[0]
self.dut.droid.wifiRemoveNetworkSuggestions([])
def setup_test(self):
@@ -434,3 +436,24 @@
self.wpa_psk_2g[WifiEnums.SSID_KEY],
assert_on_fail=False),
"Device should not connect back")
+
+ @test_tracker_info(uuid="93c86b05-fa56-4d79-ad27-009a16f691b1")
+ def test_connect_to_hidden_network(self):
+ """
+ Adds a network suggestion with hidden SSID config, ensure device can scan
+ and connect to this network.
+
+ Steps:
+ 1. Send a hidden network suggestion to the device.
+ 2. Wait for the device to connect to it.
+ 3. Ensure that we did not receive the post connection broadcast
+ (isAppInteractionRequired = False).
+ 4. Remove the suggestions and ensure the device does not connect back.
+ """
+ asserts.skip_if(not hasattr(self, "hidden_networks"), "No hidden networks, skip this test")
+
+ network_suggestion = self.hidden_network
+ self.add_suggestions_and_ensure_connection(
+ [network_suggestion], network_suggestion[WifiEnums.SSID_KEY], False)
+ self.remove_suggestions_disconnect_and_ensure_no_connection_back(
+ [network_suggestion], network_suggestion[WifiEnums.SSID_KEY])