Merge "[wifi_test_utils] Methods to verify 11ax" into sc-dev
diff --git a/acts_tests/acts_contrib/test_utils/tel/tel_5g_test_utils.py b/acts_tests/acts_contrib/test_utils/tel/tel_5g_test_utils.py
index 7b7963d..91cdd38 100644
--- a/acts_tests/acts_contrib/test_utils/tel/tel_5g_test_utils.py
+++ b/acts_tests/acts_contrib/test_utils/tel/tel_5g_test_utils.py
@@ -35,13 +35,15 @@
from acts_contrib.test_utils.tel.tel_5g_utils import is_current_network_5g_nsa
from acts_contrib.test_utils.tel.tel_5g_utils import is_current_network_5g_sa
-def provision_device_for_5g(log, ads, sa_5g=False):
+
+def provision_device_for_5g(log, ads, sa_5g=False, nsa_mmwave=False):
"""Provision Devices for 5G
Args:
log: Log object.
ads: android device object(s).
sa_5g: Check for provision on sa_5G or not
+ nsa_mmwave: If true, check the band of NSA network is mmWave. Default is to check sub-6.
Returns:
True: Device(s) are provisioned on 5G
@@ -51,17 +53,18 @@
if not provision_device_for_5g_sa(log, ads):
return False
else:
- if not provision_device_for_5g_nsa(log, ads):
+ if not provision_device_for_5g_nsa(log, ads, nsa_mmwave=nsa_mmwave):
return False
return True
-def provision_device_for_5g_nsa(log, ads):
+def provision_device_for_5g_nsa(log, ads, nsa_mmwave=False):
"""Provision Devices for 5G NSA
Args:
log: Log object.
ads: android device object(s).
+ nsa_mmwave: If true, check the band of NSA network is mmWave. Default is to check sub-6.
Returns:
True: Device(s) are provisioned on 5G NSA
@@ -74,7 +77,7 @@
log.error("failed to set preferred network mode on 5g")
return False
# Attach
- tasks = [(is_current_network_5g_nsa, [ad]) for ad in ads]
+ tasks = [(is_current_network_5g_nsa, [ad, nsa_mmwave]) for ad in ads]
if not multithread_func(log, tasks):
log.error("phone not on 5g nsa")
return False
@@ -84,7 +87,7 @@
set_preferred_mode_for_5g(ads)
# Attach nsa5g
- if not is_current_network_5g_nsa(ads):
+ if not is_current_network_5g_nsa(ads, nsa_mmwave=nsa_mmwave):
ads.log.error("Phone not attached on nsa 5g")
return False
return True
@@ -166,13 +169,14 @@
return True
-def verify_5g_attach_for_both_devices(log, ads, sa_5g=False):
+def verify_5g_attach_for_both_devices(log, ads, sa_5g=False, nsa_mmwave=False):
"""Verify the network is attached
Args:
log: Log object.
ads: android device object(s).
sa_5g: Check for verify data network type is on 5G SA or not
+ nsa_mmwave: If true, check the band of NSA network is mmWave. Default is to check sub-6.
Returns:
True: Device(s) are attached on 5G
@@ -187,7 +191,7 @@
return True
else:
# Attach
- tasks = [(is_current_network_5g_nsa, [ad]) for ad in ads]
+ tasks = [(is_current_network_5g_nsa, [ad, nsa_mmwave]) for ad in ads]
if not multithread_func(log, tasks):
log.error("phone not on 5g nsa")
return False
@@ -241,13 +245,14 @@
return True
-def check_current_network_5g(ad, timeout=30, sa_5g=False):
+def check_current_network_5g(ad, timeout=30, sa_5g=False, nsa_mmwave=False):
"""Verifies data network type is on 5G
Args:
ad: android device object.
timeout: max time to wait for event
sa_5g: Check for verify data network type is on 5G SA or not
+ nsa_mmwave: If true, check the band of NSA network is mmWave. Default is to check sub-6.
Returns:
True: if data is on 5g
@@ -257,7 +262,7 @@
if not is_current_network_5g_sa(ad):
return False
else:
- if not is_current_network_5g_nsa(ad, timeout):
+ if not is_current_network_5g_nsa(ad, nsa_mmwave=nsa_mmwave, timeout=timeout):
return False
return True
diff --git a/acts_tests/acts_contrib/test_utils/tel/tel_5g_utils.py b/acts_tests/acts_contrib/test_utils/tel/tel_5g_utils.py
index 9506e4e..fd9d4b3 100644
--- a/acts_tests/acts_contrib/test_utils/tel/tel_5g_utils.py
+++ b/acts_tests/acts_contrib/test_utils/tel/tel_5g_utils.py
@@ -19,24 +19,28 @@
from acts_contrib.test_utils.tel.tel_defines import DisplayInfoContainer
from acts_contrib.test_utils.tel.tel_defines import EventDisplayInfoChanged
-def is_current_network_5g_nsa(ad, timeout=30):
+def is_current_network_5g_nsa(ad, nsa_mmwave=False, timeout=30):
"""Verifies 5G NSA override network type
Args:
ad: android device object.
- timeout: max time to wait for event
+ nsa_mmwave: If true, check the band of NSA network is mmWave. Default is to check sub-6.
+ timeout: max time to wait for event.
Returns:
True: if data is on nsa5g NSA
False: if data is not on nsa5g NSA
"""
ad.ed.clear_events(EventDisplayInfoChanged)
ad.droid.telephonyStartTrackingDisplayInfoChange()
+ nsa_band = OverrideNetworkContainer.OVERRIDE_NETWORK_TYPE_NR_NSA
+ if nsa_mmwave:
+ nsa_band = OverrideNetworkContainer.OVERRIDE_NETWORK_TYPE_NR_MMWAVE
try:
event = ad.ed.wait_for_event(
EventDisplayInfoChanged,
ad.ed.is_event_match,
timeout=timeout,
field=DisplayInfoContainer.OVERRIDE,
- value=OverrideNetworkContainer.OVERRIDE_NETWORK_TYPE_NR_NSA)
+ value=nsa_band)
ad.log.info("Got expected event %s", event)
return True
except Empty:
@@ -46,9 +50,20 @@
ad.droid.telephonyStopTrackingDisplayInfoChange()
return None
-def is_current_network_5g_nsa_for_subscription(ad, timeout=30, sub_id=None):
+
+def is_current_network_5g_nsa_for_subscription(ad, nsa_mmwave=False, timeout=30, sub_id=None):
+ """Verifies 5G NSA override network type for subscription id.
+ Args:
+ ad: android device object.
+ nsa_mmwave: If true, check the band of NSA network is mmWave. Default is to check sub-6.
+ timeout: max time to wait for event.
+ sub_id: subscription id.
+ Returns:
+ True: if data is on nsa5g NSA
+ False: if data is not on nsa5g NSA
+ """
if not sub_id:
- return is_current_network_5g_nsa(ad)
+ return is_current_network_5g_nsa(ad, nsa_mmwave=nsa_mmwave)
voice_sub_id_changed = False
current_sub_id = ad.droid.subscriptionGetDefaultVoiceSubId()
@@ -56,7 +71,7 @@
ad.droid.subscriptionSetDefaultVoiceSubId(sub_id)
voice_sub_id_changed = True
- result = is_current_network_5g_nsa(ad)
+ result = is_current_network_5g_nsa(ad, nsa_mmwave=nsa_mmwave)
if voice_sub_id_changed:
ad.droid.subscriptionSetDefaultVoiceSubId(current_sub_id)
diff --git a/acts_tests/acts_contrib/test_utils/tel/tel_test_utils.py b/acts_tests/acts_contrib/test_utils/tel/tel_test_utils.py
index 5d6c2de..31433b7 100644
--- a/acts_tests/acts_contrib/test_utils/tel/tel_test_utils.py
+++ b/acts_tests/acts_contrib/test_utils/tel/tel_test_utils.py
@@ -188,6 +188,7 @@
from acts_contrib.test_utils.tel.tel_subscription_utils import set_subid_for_message
from acts_contrib.test_utils.tel.tel_subscription_utils import get_subid_on_same_network_of_host_ad
from acts_contrib.test_utils.tel.tel_5g_utils import is_current_network_5g_nsa_for_subscription
+from acts_contrib.test_utils.tel.tel_5g_utils import is_current_network_5g_nsa
from acts_contrib.test_utils.wifi import wifi_test_utils
from acts_contrib.test_utils.wifi import wifi_constants
from acts_contrib.test_utils.gnss import gnss_test_utils as gutils
@@ -3769,7 +3770,7 @@
return ad.curl_capable
-def start_youtube_video(ad, url="https://www.youtube.com/watch?v=pSJoP0LR8CQ"):
+def start_youtube_video(ad, url="vnd.youtube:watch?v=pSJoP0LR8CQ"):
ad.log.info("Open an youtube video")
for _ in range(3):
ad.ensure_screen_on()
diff --git a/acts_tests/acts_contrib/test_utils/wifi/wifi_constants.py b/acts_tests/acts_contrib/test_utils/wifi/wifi_constants.py
index 5f901a1..6247643 100644
--- a/acts_tests/acts_contrib/test_utils/wifi/wifi_constants.py
+++ b/acts_tests/acts_contrib/test_utils/wifi/wifi_constants.py
@@ -46,15 +46,23 @@
WIFI_AP_ENABLED_STATE = 13
WIFI_AP_FAILED_STATE = 14
+SOFTAP_RANDOMIZATION_NONE = 0
+SOFTAP_RANDOMIZATION_PERSISTENT = 1
+
# Callback Event for client number change:
# WifiManagerSoftApCallback-[callbackId]-OnNumClientsChanged
+SOFTAP_NUMBER_CLIENTS_CHANGED_WITH_INFO = "-OnConnectedClientsChangedWithInfo"
SOFTAP_NUMBER_CLIENTS_CHANGED = "-OnNumClientsChanged"
SOFTAP_NUMBER_CLIENTS_CALLBACK_KEY = "NumClients"
SOFTAP_CLIENTS_MACS_CALLBACK_KEY = "MacAddresses"
# Callback Event for softap info change
SOFTAP_INFO_CHANGED = "-OnInfoChanged"
+SOFTAP_INFOLIST_CHANGED = "-OnInfoListChanged"
SOFTAP_INFO_FREQUENCY_CALLBACK_KEY = "frequency"
SOFTAP_INFO_BANDWIDTH_CALLBACK_KEY = "bandwidth"
+SOFTAP_INFO_WIFISTANDARD_CALLBACK_KEY = "wifiStandard"
+SOFTAP_INFO_AUTO_SHUTDOWN_CALLBACK_KEY = "autoShutdownTimeoutMillis"
+SOFTAP_INFO_BSSID_CALLBACK_KEY = "bssid"
# Callback Event for softap client blocking
SOFTAP_BLOCKING_CLIENT_CONNECTING = "-OnBlockedClientConnecting"
SOFTAP_BLOCKING_CLIENT_REASON_KEY = "BlockedReason"
@@ -65,9 +73,18 @@
# Callback Event for softap capability
SOFTAP_CAPABILITY_CHANGED = "-OnCapabilityChanged"
SOFTAP_CAPABILITY_MAX_SUPPORTED_CLIENTS = "maxSupportedClients"
+SOFTAP_CAPABILITY_24GHZ_SUPPORTED_CHANNEL_LIST = "supported2GHzChannellist"
+SOFTAP_CAPABILITY_5GHZ_SUPPORTED_CHANNEL_LIST = "supported5GHzChannellist"
+SOFTAP_CAPABILITY_6GHZ_SUPPORTED_CHANNEL_LIST = "supported6GHzChannellist"
+SOFTAP_CAPABILITY_60GHZ_SUPPORTED_CHANNEL_LIST = "supported60GHzChannellist"
SOFTAP_CAPABILITY_FEATURE_ACS = "acsOffloadSupported"
SOFTAP_CAPABILITY_FEATURE_CLIENT_CONTROL = "clientForceDisconnectSupported"
SOFTAP_CAPABILITY_FEATURE_WPA3_SAE = "wpa3SaeSupported"
+SOFTAP_CAPABILITY_FEATURE_IEEE80211AX = "ieee80211axSupported"
+SOFTAP_CAPABILITY_FEATURE_24GHZ = "24gSupported"
+SOFTAP_CAPABILITY_FEATURE_5GHZ = "5gSupported"
+SOFTAP_CAPABILITY_FEATURE_6GHZ = "6gSupported"
+SOFTAP_CAPABILITY_FEATURE_60GHZ = "60gSupported"
DEFAULT_SOFTAP_TIMEOUT_S = 600 # 10 minutes
diff --git a/acts_tests/acts_contrib/test_utils/wifi/wifi_test_utils.py b/acts_tests/acts_contrib/test_utils/wifi/wifi_test_utils.py
index 71dbd26..c3d448f 100755
--- a/acts_tests/acts_contrib/test_utils/wifi/wifi_test_utils.py
+++ b/acts_tests/acts_contrib/test_utils/wifi/wifi_test_utils.py
@@ -81,6 +81,11 @@
# Used for SoftAp
AP_BAND_KEY = "apBand"
AP_CHANNEL_KEY = "apChannel"
+ AP_BANDS_KEY = "apBands"
+ AP_CHANNEL_FREQUENCYS_KEY = "apChannelFrequencies"
+ AP_MAC_RANDOMIZATION_SETTING_KEY = "MacRandomizationSetting"
+ AP_BRIDGED_OPPORTUNISTIC_SHUTDOWN_ENABLE_KEY = "BridgedModeOpportunisticShutdownEnabled"
+ AP_IEEE80211AX_ENABLED_KEY = "Ieee80211axEnabled"
AP_MAXCLIENTS_KEY = "MaxNumberOfClients"
AP_SHUTDOWNTIMEOUT_KEY = "ShutdownTimeoutMillis"
AP_SHUTDOWNTIMEOUTENABLE_KEY = "AutoShutdownEnabled"
@@ -1004,7 +1009,12 @@
shutdown_timeout_millis=None,
client_control_enable=None,
allowedList=None,
- blockedList=None):
+ blockedList=None,
+ bands=None,
+ channel_frequencys=None,
+ mac_randomization_setting=None,
+ bridged_opportunistic_shutdown_enabled=None,
+ ieee80211ax_enabled=None):
""" Save a soft ap configuration and verified
Args:
ad: android_device to set soft ap configuration.
@@ -1020,30 +1030,49 @@
client_control_enable: specifies the client control enable or not.
allowedList: specifies allowed clients list.
blockedList: specifies blocked clients list.
+ bands: specifies the band list for the soft ap.
+ channel_frequencys: specifies the channel frequency list for soft ap.
+ mac_randomization_setting: specifies the mac randomization setting.
+ bridged_opportunistic_shutdown_enabled: specifies the opportunistic
+ shutdown enable or not.
+ ieee80211ax_enabled: specifies the ieee80211ax enable or not.
"""
if security and password:
wifi_config[WifiEnums.SECURITY] = security
wifi_config[WifiEnums.PWD_KEY] = password
- if band:
- wifi_config[WifiEnums.AP_BAND_KEY] = band
- if hidden:
+ if hidden is not None:
wifi_config[WifiEnums.HIDDEN_KEY] = hidden
- if channel and band:
- wifi_config[WifiEnums.AP_BAND_KEY] = band
- wifi_config[WifiEnums.AP_CHANNEL_KEY] = channel
- if max_clients:
+ if max_clients is not None:
wifi_config[WifiEnums.AP_MAXCLIENTS_KEY] = max_clients
- if shutdown_timeout_enable:
+ if shutdown_timeout_enable is not None:
wifi_config[
WifiEnums.AP_SHUTDOWNTIMEOUTENABLE_KEY] = shutdown_timeout_enable
- if shutdown_timeout_millis:
+ if shutdown_timeout_millis is not None:
wifi_config[WifiEnums.AP_SHUTDOWNTIMEOUT_KEY] = shutdown_timeout_millis
- if client_control_enable:
+ if client_control_enable is not None:
wifi_config[WifiEnums.AP_CLIENTCONTROL_KEY] = client_control_enable
- if allowedList:
+ if allowedList is not None:
wifi_config[WifiEnums.AP_ALLOWEDLIST_KEY] = allowedList
- if blockedList:
+ if blockedList is not None:
wifi_config[WifiEnums.AP_BLOCKEDLIST_KEY] = blockedList
+ if mac_randomization_setting is not None:
+ wifi_config[WifiEnums.AP_MAC_RANDOMIZATION_SETTING_KEY
+ ] = mac_randomization_setting
+ if bridged_opportunistic_shutdown_enabled is not None:
+ wifi_config[WifiEnums.AP_BRIDGED_OPPORTUNISTIC_SHUTDOWN_ENABLE_KEY
+ ] = bridged_opportunistic_shutdown_enabled
+ if ieee80211ax_enabled is not None:
+ wifi_config[WifiEnums.AP_IEEE80211AX_ENABLED_KEY]= ieee80211ax_enabled
+ if channel_frequencys is not None:
+ wifi_config[WifiEnums.AP_CHANNEL_FREQUENCYS_KEY] = channel_frequencys
+ elif bands is not None:
+ wifi_config[WifiEnums.AP_BANDS_KEY] = bands
+ elif band is not None:
+ if channel is not None:
+ wifi_config[WifiEnums.AP_BAND_KEY] = band
+ wifi_config[WifiEnums.AP_CHANNEL_KEY] = channel
+ else:
+ wifi_config[WifiEnums.AP_BAND_KEY] = band
if WifiEnums.AP_CHANNEL_KEY in wifi_config and wifi_config[
WifiEnums.AP_CHANNEL_KEY] == 0:
@@ -1075,10 +1104,6 @@
wifi_ap[WifiEnums.HIDDEN_KEY] == wifi_config[WifiEnums.HIDDEN_KEY],
"Hotspot hidden setting doesn't match")
- if WifiEnums.AP_BAND_KEY in wifi_config:
- asserts.assert_true(
- wifi_ap[WifiEnums.AP_BAND_KEY] == wifi_config[
- WifiEnums.AP_BAND_KEY], "Hotspot Band doesn't match")
if WifiEnums.AP_CHANNEL_KEY in wifi_config:
asserts.assert_true(
wifi_ap[WifiEnums.AP_CHANNEL_KEY] == wifi_config[
@@ -1114,6 +1139,29 @@
WifiEnums.AP_BLOCKEDLIST_KEY],
"Hotspot Blocked List doesn't match")
+ if WifiEnums.AP_MAC_RANDOMIZATION_SETTING_KEY in wifi_config:
+ asserts.assert_true(
+ wifi_ap[WifiEnums.AP_MAC_RANDOMIZATION_SETTING_KEY] == wifi_config[
+ WifiEnums.AP_MAC_RANDOMIZATION_SETTING_KEY],
+ "Hotspot Mac randomization setting doesn't match")
+
+ if WifiEnums.AP_BRIDGED_OPPORTUNISTIC_SHUTDOWN_ENABLE_KEY in wifi_config:
+ asserts.assert_true(
+ wifi_ap[WifiEnums.AP_BRIDGED_OPPORTUNISTIC_SHUTDOWN_ENABLE_KEY] == wifi_config[
+ WifiEnums.AP_BRIDGED_OPPORTUNISTIC_SHUTDOWN_ENABLE_KEY],
+ "Hotspot bridged shutdown enable setting doesn't match")
+
+ if WifiEnums.AP_IEEE80211AX_ENABLED_KEY in wifi_config:
+ asserts.assert_true(
+ wifi_ap[WifiEnums.AP_IEEE80211AX_ENABLED_KEY] == wifi_config[
+ WifiEnums.AP_IEEE80211AX_ENABLED_KEY],
+ "Hotspot 80211 AX enable setting doesn't match")
+
+ if WifiEnums.AP_CHANNEL_FREQUENCYS_KEY in wifi_config:
+ asserts.assert_true(
+ wifi_ap[WifiEnums.AP_CHANNEL_FREQUENCYS_KEY] == wifi_config[
+ WifiEnums.AP_CHANNEL_FREQUENCYS_KEY],
+ "Hotspot channels setting doesn't match")
def start_wifi_tethering_saved_config(ad):
""" Turn on wifi hotspot with a config that is already saved """
@@ -2335,20 +2383,20 @@
return num_of_clients
-def get_current_softap_info(ad, callbackId, least_one):
+def get_current_softap_info(ad, callbackId, need_to_wait):
"""pop up all of softap info changed event from queue.
Args:
callbackId: Id of the callback associated with registering.
- least_one: Wait for the info callback event before pop all.
+ need_to_wait: Wait for the info callback event before pop all.
Returns:
Returns last updated information of softap.
"""
eventStr = wifi_constants.SOFTAP_CALLBACK_EVENT + str(
callbackId) + wifi_constants.SOFTAP_INFO_CHANGED
- ad.log.info("softap info dump from eventStr %s", eventStr)
+ ad.log.debug("softap info dump from eventStr %s", eventStr)
frequency = 0
bandwidth = 0
- if (least_one):
+ if (need_to_wait):
event = ad.ed.pop_event(eventStr, SHORT_TIMEOUT)
frequency = event['data'][
wifi_constants.SOFTAP_INFO_FREQUENCY_CALLBACK_KEY]
@@ -2367,6 +2415,61 @@
bandwidth)
return frequency, bandwidth
+def get_current_softap_infos(ad, callbackId, need_to_wait):
+ """pop up all of softap info list changed event from queue.
+ Args:
+ callbackId: Id of the callback associated with registering.
+ need_to_wait: Wait for the info callback event before pop all.
+ Returns:
+ Returns last updated informations of softap.
+ """
+ eventStr = wifi_constants.SOFTAP_CALLBACK_EVENT + str(
+ callbackId) + wifi_constants.SOFTAP_INFOLIST_CHANGED
+ ad.log.debug("softap info dump from eventStr %s", eventStr)
+
+ if (need_to_wait):
+ event = ad.ed.pop_event(eventStr, SHORT_TIMEOUT)
+ infos = event['data']
+
+ events = ad.ed.pop_all(eventStr)
+ for event in events:
+ infos = event['data']
+
+ for info in infos:
+ frequency = info[
+ wifi_constants.SOFTAP_INFO_FREQUENCY_CALLBACK_KEY]
+ bandwidth = info[
+ wifi_constants.SOFTAP_INFO_BANDWIDTH_CALLBACK_KEY]
+ wifistandard = info[
+ wifi_constants.SOFTAP_INFO_WIFISTANDARD_CALLBACK_KEY]
+ bssid = info[
+ wifi_constants.SOFTAP_INFO_BSSID_CALLBACK_KEY]
+ ad.log.info(
+ "softap info, freq:%s, bw:%s, wifistandard:%s, bssid:%s",
+ frequency, bandwidth, wifistandard, bssid)
+
+ return infos
+
+def get_current_softap_capability(ad, callbackId, need_to_wait):
+ """pop up all of softap info list changed event from queue.
+ Args:
+ callbackId: Id of the callback associated with registering.
+ need_to_wait: Wait for the info callback event before pop all.
+ Returns:
+ Returns last updated capability of softap.
+ """
+ eventStr = wifi_constants.SOFTAP_CALLBACK_EVENT + str(
+ callbackId) + wifi_constants.SOFTAP_CAPABILITY_CHANGED
+ ad.log.debug("softap capability dump from eventStr %s", eventStr)
+ if (need_to_wait):
+ event = ad.ed.pop_event(eventStr, SHORT_TIMEOUT)
+ capability = event['data']
+
+ events = ad.ed.pop_all(eventStr)
+ for event in events:
+ capability = event['data']
+
+ return capability
def get_ssrdumps(ad):
"""Pulls dumps in the ssrdump dir
diff --git a/acts_tests/tests/google/nr/nsa5g/Nsa5gSmsTest.py b/acts_tests/tests/google/nr/nsa5g/Nsa5gSmsTest.py
index 38a78d6..26ab60a 100755
--- a/acts_tests/tests/google/nr/nsa5g/Nsa5gSmsTest.py
+++ b/acts_tests/tests/google/nr/nsa5g/Nsa5gSmsTest.py
@@ -22,13 +22,18 @@
from acts.test_decorators import test_tracker_info
from acts_contrib.test_utils.tel.TelephonyBaseTest import TelephonyBaseTest
from acts_contrib.test_utils.tel.tel_defines import WAIT_TIME_ANDROID_STATE_SETTLING
+from acts_contrib.test_utils.tel.tel_defines import WFC_MODE_WIFI_PREFERRED
+from acts_contrib.test_utils.tel.tel_defines import WFC_MODE_CELLULAR_PREFERRED
from acts_contrib.test_utils.tel.tel_test_utils import ensure_phones_idle
from acts_contrib.test_utils.tel.tel_test_utils import hangup_call
from acts_contrib.test_utils.tel.tel_test_utils import ensure_phone_default_state
from acts_contrib.test_utils.tel.tel_test_utils import multithread_func
+from acts_contrib.test_utils.tel.tel_test_utils import toggle_airplane_mode
from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call_iwlan
from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call_volte
from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call_csfb
+from acts_contrib.test_utils.tel.tel_voice_utils import phone_setup_volte
+from acts_contrib.test_utils.tel.tel_voice_utils import phone_setup_iwlan
from acts_contrib.test_utils.tel.tel_5g_test_utils import disable_apm_mode_both_devices
from acts_contrib.test_utils.tel.tel_5g_test_utils import provision_device_for_5g
from acts_contrib.test_utils.tel.tel_5g_test_utils import provision_both_devices_for_volte
@@ -36,6 +41,7 @@
from acts_contrib.test_utils.tel.tel_5g_test_utils import provision_both_devices_for_wfc_wifi_pref
from acts_contrib.test_utils.tel.tel_5g_test_utils import verify_5g_attach_for_both_devices
from acts_contrib.test_utils.tel.tel_5g_test_utils import provision_both_devices_for_csfb
+from acts_contrib.test_utils.tel.tel_5g_test_utils import provision_device_for_5g_nsa
from acts_contrib.test_utils.tel.tel_5g_utils import is_current_network_5g_nsa
from acts_contrib.test_utils.tel.tel_sms_utils import _sms_test_mo
from acts_contrib.test_utils.tel.tel_sms_utils import _sms_test_mt
@@ -84,6 +90,7 @@
return True
+ @test_tracker_info(uuid="52b16764-0c9e-45c0-910f-a39d17c7cf7e")
@TelephonyBaseTest.tel_test_wrap
def test_5g_nsa_sms_mo_general(self):
"""Test MO SMS for 1 phone in 5g NSA. The other phone in any network
@@ -113,6 +120,7 @@
return True
+ @test_tracker_info(uuid="e9b2494a-0e40-449c-b877-1e4ddc78c536")
@TelephonyBaseTest.tel_test_wrap
def test_5g_nsa_sms_mt_general(self):
"""Test MT SMS for 1 phone in 5g NSA. The other phone in any network
@@ -178,6 +186,74 @@
return True
+ @test_tracker_info(uuid="e51f3dbb-bb16-4400-b2be-f9422f511087")
+ @TelephonyBaseTest.tel_test_wrap
+ def test_5g_nsa_sms_mo_volte(self):
+ """Test MO SMS with VoLTE on 5G NSA. The other phone in any network
+
+ Provision PhoneA on VoLTE
+ Provision PhoneA in 5g NSA
+ Send and Verify SMS from PhoneA to PhoneB
+ Verify PhoneA is still on 5g NSA
+
+ Returns:
+ True if success.
+ False if failed.
+ """
+
+ ads = self.android_devices
+ if not phone_setup_volte(self.log, ads[0]):
+ return False
+
+ tasks = [(provision_device_for_5g, (self.log, ads[0])),
+ (ensure_phone_default_state, (self.log, ads[1]))]
+ if not multithread_func(self.log, tasks):
+ return False
+
+ if not _sms_test_mo(self.log, ads):
+ return False
+
+ if not is_current_network_5g_nsa(ads[0]):
+ return False
+
+ self.log.info("PASS - MO VoLTE SMS test over 5G NSA validated")
+ return True
+
+
+ @test_tracker_info(uuid="5217d427-04a2-4b2b-9ed8-28951e71fc21")
+ @TelephonyBaseTest.tel_test_wrap
+ def test_5g_nsa_sms_mt_volte(self):
+ """Test MT SMS with VoLTE on 5G NSA. The other phone in any network
+
+ Provision PhoneA on VoLTE
+ Provision PhoneA in 5g NSA
+ Send and Verify SMS from PhoneB to PhoneA
+ Verify phoneA is still on 5g NSA
+
+ Returns:
+ True if success.
+ False if failed.
+ """
+
+ ads = self.android_devices
+ if not phone_setup_volte(self.log, ads[0]):
+ return False
+
+ tasks = [(provision_device_for_5g, (self.log, ads[0])),
+ (ensure_phone_default_state, (self.log, ads[1]))]
+ if not multithread_func(self.log, tasks):
+ return False
+
+ if not _sms_test_mt(self.log, ads):
+ return False
+
+ if not is_current_network_5g_nsa(ads[0]):
+ return False
+
+ self.log.info("PASS - MT VoLTE SMS test over 5G NSA validated")
+ return True
+
+
@test_tracker_info(uuid="49bfb4b3-a6ec-45d4-ad96-09282fb07d1d")
@TelephonyBaseTest.tel_test_wrap
def test_5g_nsa_sms_mo_mt_in_call_volte(self):
@@ -210,6 +286,74 @@
return True
+ @test_tracker_info(uuid="3d5c8f60-1eaa-4f4a-b539-c529fa36db91")
+ @TelephonyBaseTest.tel_test_wrap
+ def test_5g_nsa_sms_mo_in_call_volte(self):
+ """ Test MO SMS during a MO VoLTE call over 5G NSA.
+
+ Provision PhoneA on VoLTE
+ Provision PhoneA in 5g NSA
+ Make a Voice call from PhoneA to PhoneB
+ Send and Verify SMS from PhoneA to PhoneB
+ Verify phoneA is still on 5g NSA
+
+ Returns:
+ True if pass; False if fail.
+ """
+ ads = self.android_devices
+ if not phone_setup_volte(self.log, ads[0]):
+ return False
+ time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
+
+ tasks = [(provision_device_for_5g, (self.log, ads[0])),
+ (ensure_phone_default_state, (self.log, ads[1]))]
+ if not multithread_func(self.log, tasks):
+ return False
+
+ if not test_sms_mo_in_call(self.log,
+ ads,
+ caller_func=is_phone_in_call_volte):
+ return False
+
+ if not is_current_network_5g_nsa(ads[0]):
+ return False
+ return True
+
+
+ @test_tracker_info(uuid="c71813f3-bb04-4115-8519-e23046349689")
+ @TelephonyBaseTest.tel_test_wrap
+ def test_5g_nsa_sms_mt_in_call_volte(self):
+ """ Test MT SMS during a MT VoLTE call over 5G NSA.
+
+ Provision PhoneA on VoLTE
+ Provision PhoneA in 5g NSA
+ Make a Voice call from PhoneB to PhoneA
+ Send and Verify SMS from PhoneB to PhoneA
+ Verify phoneA is still on 5g NSA
+
+ Returns:
+ True if pass; False if fail.
+ """
+ ads = self.android_devices
+ if not phone_setup_volte(self.log, ads[0]):
+ return False
+ time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
+
+ tasks = [(provision_device_for_5g, (self.log, ads[0])),
+ (ensure_phone_default_state, (self.log, ads[1]))]
+ if not multithread_func(self.log, tasks):
+ return False
+
+ if not test_sms_mo_in_call(self.log,
+ [ads[1], ads[0]],
+ callee_func=is_phone_in_call_volte):
+ return False
+
+ if not is_current_network_5g_nsa(ads[0]):
+ return False
+ return True
+
+
@test_tracker_info(uuid="1f914d5c-ac24-4794-9fcb-cb28e483d69a")
@TelephonyBaseTest.tel_test_wrap
def test_5g_nsa_sms_mo_mt_iwlan(self):
@@ -372,11 +516,179 @@
return False
time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
- if not provision_both_devices_for_5g(self.log, ads):
+ if not provision_device_for_5g_nsa(self.log, ads):
return False
return test_sms_mo_in_call(self.log,
ads,
caller_func=is_phone_in_call_csfb)
+
+ @test_tracker_info(uuid="2d375f20-a785-42e0-b5a1-968d19bc693d")
+ @TelephonyBaseTest.tel_test_wrap
+ def test_5g_nsa_sms_mo_iwlan(self):
+ """ Test MO SMS for 1 phone in APM,
+ WiFi connected, WFC Cell Preferred mode.
+
+ Disable APM on PhoneA
+ Provision PhoneA in 5g NSA
+ Provision PhoneA for WFC Cell Pref with APM ON
+ Send and Verify SMS from PhoneA to PhoneB
+
+ Returns:
+ True if pass; False if fail.
+ """
+
+ ads = self.android_devices
+ if not toggle_airplane_mode(self.log, ads[0], False):
+ return False
+
+ tasks = [(provision_device_for_5g, (self.log, ads[0])),
+ (ensure_phone_default_state, (self.log, ads[1]))]
+ if not multithread_func(self.log, tasks):
+ return False
+
+ if not phone_setup_iwlan(self.log,
+ ads[0],
+ True,
+ WFC_MODE_CELLULAR_PREFERRED,
+ self.wifi_network_ssid,
+ self.wifi_network_pass):
+ return False
+ time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
+
+ if not _sms_test_mo(self.log, ads):
+ return False
+
+ self.log.info("PASS - iwlan mo sms test over 5g nsa validated")
+ return True
+
+
+ @test_tracker_info(uuid="db8b2b5b-bf9e-4a99-9fdb-dbd028567705")
+ @TelephonyBaseTest.tel_test_wrap
+ def test_5g_nsa_sms_mt_iwlan(self):
+ """ Test MT SMS for 1 phone in APM,
+ WiFi connected, WFC Cell Preferred mode.
+
+ Disable APM on PhoneA
+ Provision PhoneA in 5g NSA
+ Provision PhoneA for WFC Cell Pref with APM ON
+ Send and Verify SMS from PhoneB to PhoneA
+
+ Returns:
+ True if pass; False if fail.
+ """
+
+ ads = self.android_devices
+ if not toggle_airplane_mode(self.log, ads[0], False):
+ return False
+
+ tasks = [(provision_device_for_5g, (self.log, ads[0])),
+ (ensure_phone_default_state, (self.log, ads[1]))]
+ if not multithread_func(self.log, tasks):
+ return False
+
+ if not phone_setup_iwlan(self.log,
+ ads[0],
+ True,
+ WFC_MODE_CELLULAR_PREFERRED,
+ self.wifi_network_ssid,
+ self.wifi_network_pass):
+ return False
+ time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
+
+ if not _sms_test_mo(self.log, [ads[1], ads[0]]):
+ return False
+
+ self.log.info("PASS - iwlan mt sms test over 5g nsa validated")
+ return True
+
+
+ @test_tracker_info(uuid="5997a618-efee-478f-8fa9-6cf8ba9cfc58")
+ @TelephonyBaseTest.tel_test_wrap
+ def test_5g_nsa_sms_mo_iwlan_apm_off(self):
+ """ Test MO SMS for 1 Phone in APM off, WiFi connected,
+ WFC WiFi Preferred mode.
+
+ Disable APM on PhoneA
+ Provision PhoneA in 5g NSA
+ Provision PhoneA for WFC Wifi Pref with APM OFF
+ Send and Verify SMS from PhoneA to PhoneB
+ Verify 5g NSA attach for PhoneA
+
+ Returns:
+ True if pass; False if fail.
+ """
+
+ ads = self.android_devices
+ if not toggle_airplane_mode(self.log, ads[0], False):
+ return False
+
+ tasks = [(provision_device_for_5g, (self.log, ads[0])),
+ (ensure_phone_default_state, (self.log, ads[1]))]
+ if not multithread_func(self.log, tasks):
+ return False
+
+ if not phone_setup_iwlan(self.log,
+ ads[0],
+ False,
+ WFC_MODE_WIFI_PREFERRED,
+ self.wifi_network_ssid,
+ self.wifi_network_pass):
+ return False
+ time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
+
+ if not _sms_test_mo(self.log, ads):
+ self.log.error("failed to send receive sms over 5g nsa")
+ return False
+ self.log.info("PASS - iwlan MO sms test over 5g nsa validated")
+
+ if not is_current_network_5g_nsa(ads[0]):
+ return False
+ return True
+
+
+ @test_tracker_info(uuid="352ca023-2cd1-4b08-877c-20c5d50cc265")
+ @TelephonyBaseTest.tel_test_wrap
+ def test_5g_nsa_sms_mt_iwlan_apm_off(self):
+ """ Test MT SMS for 1 Phone in APM off, WiFi connected,
+ WFC WiFi Preferred mode.
+
+ Disable APM on PhoneA
+ Provision PhoneA in 5g NSA
+ Provision PhoneA for WFC Wifi Pref with APM OFF
+ Send and Verify SMS from PhoneB to PhoneA
+ Verify 5g NSA attach for PhoneA
+
+ Returns:
+ True if pass; False if fail.
+ """
+
+ ads = self.android_devices
+ if not toggle_airplane_mode(self.log, ads[0], False):
+ return False
+
+ tasks = [(provision_device_for_5g, (self.log, ads[0])),
+ (ensure_phone_default_state, (self.log, ads[1]))]
+ if not multithread_func(self.log, tasks):
+ return False
+
+ if not phone_setup_iwlan(self.log,
+ ads[0],
+ False,
+ WFC_MODE_WIFI_PREFERRED,
+ self.wifi_network_ssid,
+ self.wifi_network_pass):
+ return False
+ time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
+
+ if not _sms_test_mt(self.log, ads):
+ self.log.error("failed to send receive sms over 5g nsa")
+ return False
+ self.log.info("PASS - iwlan MT sms test over 5g nsa validated")
+
+ if not is_current_network_5g_nsa(ads[0]):
+ return False
+ return True
+
""" Tests End """
diff --git a/acts_tests/tests/google/tel/live/TelLiveStressTest.py b/acts_tests/tests/google/tel/live/TelLiveStressTest.py
index 96cc9e3..80d3e7e 100644
--- a/acts_tests/tests/google/tel/live/TelLiveStressTest.py
+++ b/acts_tests/tests/google/tel/live/TelLiveStressTest.py
@@ -103,7 +103,7 @@
from acts_contrib.test_utils.tel.tel_subscription_utils import set_subid_for_message
from acts_contrib.test_utils.tel.tel_subscription_utils import set_subid_for_outgoing_call
from acts_contrib.test_utils.tel.tel_subscription_utils import set_always_allow_mms_data
-from acts_contrib.test_utils.tel.tel_5g_utils import provision_device_for_5g
+from acts_contrib.test_utils.tel.tel_5g_test_utils import provision_device_for_5g
from acts.utils import get_current_epoch_time
from acts.utils import rand_ascii_str
diff --git a/acts_tests/tests/google/tel/live/TelLiveVoiceTest.py b/acts_tests/tests/google/tel/live/TelLiveVoiceTest.py
index 7f38424..a5f0117 100644
--- a/acts_tests/tests/google/tel/live/TelLiveVoiceTest.py
+++ b/acts_tests/tests/google/tel/live/TelLiveVoiceTest.py
@@ -65,8 +65,6 @@
from acts_contrib.test_utils.tel.tel_test_utils import set_wifi_to_default
from acts_contrib.test_utils.tel.tel_test_utils import STORY_LINE
from acts_contrib.test_utils.tel.tel_test_utils import wait_for_in_call_active
-from acts_contrib.test_utils.tel.tel_test_utils import set_preferred_mode_for_5g
-from acts_contrib.test_utils.tel.tel_test_utils import is_current_network_5g_nsa
from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call_1x
from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call_2g
from acts_contrib.test_utils.tel.tel_voice_utils import is_phone_in_call_3g
diff --git a/acts_tests/tests/google/wifi/WifiEnterpriseTest.py b/acts_tests/tests/google/wifi/WifiEnterpriseTest.py
index 2758f41..e4fafb0 100644
--- a/acts_tests/tests/google/wifi/WifiEnterpriseTest.py
+++ b/acts_tests/tests/google/wifi/WifiEnterpriseTest.py
@@ -339,6 +339,21 @@
finally:
self.dut.droid.wifiLockRelease()
+ def check_connection(self, network_bssid):
+ """Check current wifi connection networks.
+ Args:
+ network_bssid: Network bssid to which connection.
+ Returns:
+ True if connection to given network happen, else return False.
+ """
+ time.sleep(10) #time for connection state to be updated
+ self.log.info("Check network for {}".format(network_bssid))
+ current_network = self.dut.droid.wifiGetConnectionInfo()
+ self.log.debug("Current network: {}".format(current_network))
+ if WifiEnums.BSSID_KEY in current_network:
+ return current_network[WifiEnums.BSSID_KEY] == network_bssid
+ return False
+
""" Tests """
# EAP connect tests
diff --git a/acts_tests/tests/google/wifi/WifiManagerTest.py b/acts_tests/tests/google/wifi/WifiManagerTest.py
index 83b19c5..dbb447e 100644
--- a/acts_tests/tests/google/wifi/WifiManagerTest.py
+++ b/acts_tests/tests/google/wifi/WifiManagerTest.py
@@ -1016,6 +1016,31 @@
self.dut.droid.wakeLockAcquireBright()
self.dut.droid.wakeUpNow()
+ @test_tracker_info(uuid="25e8dd62-ae9f-46f7-96aa-030fee95dfda")
+ def test_wifi_saved_network_reset(self):
+ """Verify DUT can reset Wi-Fi saved network list after add a network.
+
+ Steps:
+ 1. Connect to a 2GHz network
+ 2. Reset the Wi-Fi saved network
+ 3. Verify the saved network has been clear
+ """
+ ssid = self.open_network_2g[WifiEnums.SSID_KEY]
+ nId = self.dut.droid.wifiAddNetwork(self.open_network_2g)
+ asserts.assert_true(nId > -1, "Failed to add network.")
+ configured_networks = self.dut.droid.wifiGetConfiguredNetworks()
+ self.log.debug(
+ ("Configured networks after adding: %s" % configured_networks))
+ wutils.assert_network_in_list({
+ WifiEnums.SSID_KEY: ssid
+ }, configured_networks)
+ self.dut.droid.wifiFactoryReset()
+ configured_networks = self.dut.droid.wifiGetConfiguredNetworks()
+ for nw in configured_networks:
+ asserts.assert_true(
+ nw[WifiEnums.BSSID_KEY] != ssid,
+ "Found saved network %s in configured networks." % ssid)
+
@test_tracker_info(uuid="402cfaa8-297f-4865-9e27-6bab6adca756")
def test_reboot_wifi_and_bluetooth_on(self):
"""Toggle WiFi and bluetooth ON then reboot """
diff --git a/acts_tests/tests/google/wifi/WifiSoftApTest.py b/acts_tests/tests/google/wifi/WifiSoftApTest.py
index 741b57a..db22550 100644
--- a/acts_tests/tests/google/wifi/WifiSoftApTest.py
+++ b/acts_tests/tests/google/wifi/WifiSoftApTest.py
@@ -992,7 +992,9 @@
1. Get current softap configuration
2. Update to Open Security configuration
3. Update to WPA2_PSK configuration
- 4. Restore the configuration
+ 4. Update to Multi-Channels, Mac Randomization off,
+ bridged_shutdown off, 11ax off configuration which are introduced in S.
+ 5. Restore the configuration
"""
# Backup config
original_softap_config = self.dut.droid.wifiGetApConfiguration()
@@ -1010,6 +1012,13 @@
shutdown_timeout_millis=10000, client_control_enable=False,
allowedList=["aa:bb:cc:dd:ee:ff"], blockedList=["11:22:33:44:55:66"])
+
+ wutils.save_wifi_soft_ap_config(self.dut, {"SSID":"ACTS_TEST"},
+ channel_frequencys=[2412,5745],
+ mac_randomization_setting = wifi_constants.SOFTAP_RANDOMIZATION_NONE,
+ bridged_opportunistic_shutdown_enabled=False,
+ ieee80211ax_enabled=False)
+
# Restore config
wutils.save_wifi_soft_ap_config(self.dut, original_softap_config)
diff --git a/acts_tests/tests/google/wifi/WifiWpa3OweTest.py b/acts_tests/tests/google/wifi/WifiWpa3OweTest.py
index 1cfaea9..4d970e7 100644
--- a/acts_tests/tests/google/wifi/WifiWpa3OweTest.py
+++ b/acts_tests/tests/google/wifi/WifiWpa3OweTest.py
@@ -36,10 +36,10 @@
self.dut = self.android_devices[0]
wutils.wifi_test_device_init(self.dut)
- opt_params = ["owe_networks", "sae_networks", "wpa3_sae_gcmp_128",
- "wpa3_sae_gcmp_256"]
- self.unpack_userparams(opt_param_names=opt_params)
- wutils.wifi_toggle_state(self.dut, True)
+ opt_params = ["owe_networks", "sae_networks"]
+ req_params = ["wpa3_sae_gcmp_128", "wpa3_sae_gcmp_256", "wifi6_models"]
+ self.unpack_userparams(opt_param_names=opt_params,
+ req_param_names=req_params)
if "OpenWrtAP" in self.user_params:
self.configure_openwrt_ap_and_start(owe_network=True,
sae_network=True)
@@ -75,10 +75,14 @@
@test_tracker_info(uuid="3670702a-3d78-4184-b5e1-7fcf5fa48fd8")
def test_connect_to_wpa3_personal_2g(self):
wutils.connect_to_wifi_network(self.dut, self.wpa3_personal_2g)
+ wutils.verify_11ax_wifi_connection(
+ self.dut, self.wifi6_models, "wifi6_ap" in self.user_params)
@test_tracker_info(uuid="c4528eaf-7960-4ecd-8f11-d5439bdf1c58")
def test_connect_to_wpa3_personal_5g(self):
wutils.connect_to_wifi_network(self.dut, self.wpa3_personal_5g)
+ wutils.verify_11ax_wifi_connection(
+ self.dut, self.wifi6_models, "wifi6_ap" in self.user_params)
@test_tracker_info(uuid="a8fb46be-3487-4dc8-a393-5af992b27f45")
def test_connect_to_wpa3_personal_reconnection(self):
@@ -92,8 +96,12 @@
Second connect request from framework succeeds.
"""
wutils.connect_to_wifi_network(self.dut, self.wpa3_personal_2g)
+ wutils.verify_11ax_wifi_connection(
+ self.dut, self.wifi6_models, "wifi6_ap" in self.user_params)
wutils.toggle_wifi_off_and_on(self.dut)
wutils.connect_to_wifi_network(self.dut, self.wpa3_personal_2g)
+ wutils.verify_11ax_wifi_connection(
+ self.dut, self.wifi6_models, "wifi6_ap" in self.user_params)
@test_tracker_info(uuid="")
def test_connect_to_wpa3_personal_gcmp_128(self):
diff --git a/acts_tests/tests/google/wifi/WifiWpaPersonalTest.py b/acts_tests/tests/google/wifi/WifiWpaPersonalTest.py
index c6b32c6..ad8856a 100644
--- a/acts_tests/tests/google/wifi/WifiWpaPersonalTest.py
+++ b/acts_tests/tests/google/wifi/WifiWpaPersonalTest.py
@@ -14,33 +14,37 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+import time
-import acts_contrib.test_utils.wifi.wifi_test_utils as wutils
-from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
+from acts import asserts
+from acts import utils
+from acts import signals
from acts.controllers.openwrt_lib.openwrt_constants import OpenWrtWifiSecurity
from acts.test_decorators import test_tracker_info
-from acts import asserts
+import acts_contrib.test_utils.wifi.wifi_test_utils as wutils
+from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
WifiEnums = wutils.WifiEnums
class WifiWpaPersonalTest(WifiBaseTest):
- """ Wi-Fi WPA test
+ """Test for WPA Personal.
- Test Bed Requirement:
- * One Android device
- * One OpenWrt Wi-Fi AP.
+ Test Bed Requirement:
+ * One Android device without sim card.
+ * One OpenWrt Wi-Fi AP.
"""
+
def setup_class(self):
super().setup_class()
self.dut = self.android_devices[0]
- if 'OpenWrtAP' in self.user_params:
+ if "OpenWrtAP" in self.user_params:
self.openwrt = self.access_points[0]
self.configure_openwrt_ap_and_start(wpa1_network=True)
- req_params = ["OpenWrtAP"]
+ req_params = ["OpenWrtAP", "roaming_attn"]
opt_params = ["pixel_models", "cnss_diag_file"]
self.unpack_userparams(req_params, opt_params)
self.wpa_psk_2g = self.wpa1_networks[0]["2g"]
@@ -59,6 +63,7 @@
ad.droid.wakeLockRelease()
ad.droid.goToSleepNow()
wutils.reset_wifi(self.dut)
+ utils.force_airplane_mode(self.dut, False)
def teardown_class(self):
super().teardown_class()
@@ -70,27 +75,29 @@
def verify_wpa_network_encryption(self, encryption):
result = wutils.get_wlan0_link(self.dut)
- if encryption == 'psk+ccmp':
+ if encryption == "psk+ccmp":
asserts.assert_true(
- result['pairwise_cipher'] == 'CCMP' and
- result['group_cipher'] == 'CCMP',
- 'DUT does not connect to {} encryption network'.format(encryption))
- elif encryption == 'psk+tkip':
+ result["pairwise_cipher"] == "CCMP" and
+ result["group_cipher"] == "CCMP",
+ "DUT does not connect to {} encryption network".format(encryption))
+ elif encryption == "psk+tkip":
asserts.assert_true(
- result['pairwise_cipher'] == 'TKIP' and
- result['group_cipher'] == 'TKIP',
- 'DUT does not connect to {} encryption network'.format(encryption))
- elif encryption == 'psk+tkip+ccmp':
+ result["pairwise_cipher"] == "TKIP" and
+ result["group_cipher"] == "TKIP",
+ "DUT does not connect to {} encryption network".format(encryption))
+ elif encryption == "psk+tkip+ccmp":
asserts.assert_true(
- result['pairwise_cipher'] == 'CCMP' and
- result['group_cipher'] == 'TKIP',
- 'DUT does not connect to {} encryption network'.format(encryption))
+ result["pairwise_cipher"] == "CCMP" and
+ result["group_cipher"] == "TKIP",
+ "DUT does not connect to {} encryption network".format(encryption))
- """ Tests"""
+ ### Tests ###
@test_tracker_info(uuid="0c68a772-b70c-47d6-88ab-1b069c1d8005")
def test_connect_to_wpa_psk_ccmp_2g(self):
- """
+ """Test connection between DUT and WPA PSK CCMP 2G.
+
+ Steps:
Change AP's security type to "WPA" and cipher to "CCMP".
Connect to 2g network.
"""
@@ -103,11 +110,13 @@
@test_tracker_info(uuid="4722dffc-2960-4459-9729-0f8114af2321")
def test_connect_to_wpa_psk_ccmp_5g(self):
- """
- Change AP's security type to "WPA" and cipher to "CCMp".
+ """Test connection between DUT and WPA PSK CCMP 5G.
+
+ Steps:
+ Change AP's security type to "WPA" and cipher to "CCMP".
Connect to 5g network.
"""
- self.openwrt.log.info("Enable WPA-PSK CCMp on OpenWrt AP")
+ self.openwrt.log.info("Enable WPA-PSK CCMP on OpenWrt AP")
self.openwrt.set_wpa_encryption(OpenWrtWifiSecurity.WPA_PSK_CCMP)
wutils.start_wifi_connection_scan_and_ensure_network_found(
self.dut, self.wpa_psk_5g[WifiEnums.SSID_KEY])
@@ -116,10 +125,11 @@
@test_tracker_info(uuid="4759503e-ef9c-430b-9306-b96a347ca3de")
def test_connect_to_wpa_psk_tkip_2g(self):
- """
+ """Test connection between DUT and WPA PSK TKIP 2G.
+
Steps:
- Change AP's security type to "WPA" and cipher to "TKIP".
- Connect to 2g network.
+ Change AP's security type to "WPA" and cipher to "TKIP".
+ Connect to 2g network.
"""
self.openwrt.log.info("Enable WPA-TKIP on OpenWrt AP")
self.openwrt.set_wpa_encryption(OpenWrtWifiSecurity.WPA_PSK_TKIP)
@@ -130,10 +140,11 @@
@test_tracker_info(uuid="9c836ca6-af14-4d6b-a98e-227fb29e84ee")
def test_connect_to_wpa_psk_tkip_5g(self):
- """
+ """Test connection between DUT and WPA PSK TKIP 5G.
+
Steps:
- Change AP's security type to "WPA" and cipher to "TKIP".
- Connect to 5g network.
+ Change AP's security type to "WPA" and cipher to "TKIP".
+ Connect to 5g network.
"""
self.openwrt.log.info("Enable WPA-PSK TKIP on OpenWrt AP")
self.openwrt.set_wpa_encryption(OpenWrtWifiSecurity.WPA_PSK_TKIP)
@@ -143,10 +154,11 @@
@test_tracker_info(uuid="c03b362b-cd03-4e34-a99a-ef80a9db6db9")
def test_connect_to_wpa_psk_tkip_and_ccmp_2g(self):
- """
+ """Test connection between DUT and WPA PSK CCMP+TKIP 2G.
+
Steps:
- Change AP's security type to "WPA" and cipher to "CCMP and TKIP".
- Connect to 2g network.
+ Change AP's security type to "WPA" and cipher to "CCMP and TKIP".
+ Connect to 2g network.
"""
self.openwrt.log.info("Enable WPA-PSK CCMP and TKIP on OpenWrt AP")
self.openwrt.set_wpa_encryption(OpenWrtWifiSecurity.WPA_PSK_TKIP_AND_CCMP)
@@ -158,7 +170,8 @@
@test_tracker_info(uuid="203d7e7f-536d-4feb-9aa2-648f1f9a685d")
def test_connect_to_wpa_psk_tkip_and_ccmp_5g(self):
- """
+ """Test connection between DUT and WPA PSK CCMP+TKIP 5G.
+
Steps:
Change AP's security type to "WPA" and cipher to "CCMP and TKIP".
Connect to 5g network.
@@ -170,3 +183,165 @@
wutils.connect_to_wifi_network(self.dut, self.wpa_psk_5g)
self.verify_wpa_network_encryption(
OpenWrtWifiSecurity.WPA_PSK_TKIP_AND_CCMP)
+
+ @test_tracker_info(uuid="20a41f61-4fda-4fe9-82ee-482ecd8c82eb")
+ def test_connect_to_wpa_psk_ccmp_2g_after_airplane_mode(self):
+ """Test Wi-Fi reconnection after enabling Airplane Mode.
+
+ Steps:
+ DUT connect to 2GHz Wi-Fi network.
+ DUT turns ON Airplane Mode.
+ DUT turns ON Wi-Fi.
+ DUT verify internet connection with HTTP ping.
+ DUT turns OFF Airplane Mode.
+ DUT verify internet connection with HTTP ping.
+ """
+ self.openwrt.log.info("Enable WPA-PSK CCMP on OpenWrt AP")
+ self.openwrt.set_wpa_encryption(OpenWrtWifiSecurity.WPA_PSK_CCMP)
+ wutils.start_wifi_connection_scan_and_ensure_network_found(
+ self.dut, self.wpa_psk_2g[WifiEnums.SSID_KEY])
+ wutils.connect_to_wifi_network(self.dut, self.wpa_psk_2g)
+ self.verify_wpa_network_encryption(OpenWrtWifiSecurity.WPA_PSK_CCMP)
+ # Turn ON DUT"s Airplane Mode.
+ self.dut.log.info("Toggle Airplane Mode ON")
+ utils.force_airplane_mode(self.dut, True)
+ self.dut.log.info("Toggle Wi-Fi ON")
+ # Turn ON DUT"s Wi-Fi
+ wutils.wifi_toggle_state(self.dut, True)
+ wutils.wait_for_connect(self.dut,
+ self.wpa_psk_2g[WifiEnums.SSID_KEY])
+ wutils.validate_connection(self.dut)
+ utils.force_airplane_mode(self.dut, False)
+ wutils.validate_connection(self.dut)
+
+ @test_tracker_info(uuid="df89c92b-a30c-4485-ab45-daef5240c027")
+ def test_connect_to_wpa_psk_ccmp_2g_after_wifi_off(self):
+ """Test Wi-Fi reconnection after Turn OFF Wi-Fi.
+
+ Steps:
+ DUT connect to 2GHz Wi-Fi network.
+ DUT turns OFF Wi-Fi.
+ DUT turns ON Wi-Fi.
+ DUT verify internet connection with HTTP ping.
+ """
+ self.openwrt.log.info("Enable WPA-PSK CCMP on OpenWrt AP")
+ self.openwrt.set_wpa_encryption(OpenWrtWifiSecurity.WPA_PSK_CCMP)
+ wutils.start_wifi_connection_scan_and_ensure_network_found(
+ self.dut, self.wpa_psk_2g[WifiEnums.SSID_KEY])
+ wutils.connect_to_wifi_network(self.dut, self.wpa_psk_2g)
+ self.verify_wpa_network_encryption(OpenWrtWifiSecurity.WPA_PSK_CCMP)
+ self.dut.log.info("Toggle Wi-Fi OFF")
+ # Turn OFF DUT"s Wi-Fi then Turn if ON.
+ wutils.wifi_toggle_state(self.dut, False)
+ wutils.wifi_toggle_state(self.dut, True)
+ wutils.wait_for_connect(self.dut,
+ self.wpa_psk_2g[WifiEnums.SSID_KEY])
+ wutils.validate_connection(self.dut)
+
+ @test_tracker_info(uuid="c591e687-340c-42e6-8d85-58a1f930b6b1")
+ def test_connect_to_wpa_psk_ccmp_2g_after_suspend_resume(self):
+ """Test Wi-Fi reconnection after Suspend.
+
+ Steps:
+ DUT connect to 2GHz Wi-Fi network.
+ DUT suspend and resume.
+ DUT verify internet connection with HTTP ping.
+ """
+ self.openwrt.log.info("Enable WPA-PSK CCMP on OpenWrt AP")
+ self.openwrt.set_wpa_encryption(OpenWrtWifiSecurity.WPA_PSK_CCMP)
+ wutils.start_wifi_connection_scan_and_ensure_network_found(
+ self.dut, self.wpa_psk_2g[WifiEnums.SSID_KEY])
+ wutils.connect_to_wifi_network(self.dut, self.wpa_psk_2g)
+ self.verify_wpa_network_encryption(OpenWrtWifiSecurity.WPA_PSK_CCMP)
+ self.dut.log.info("Suspend the DUT and wait for 10 seconds")
+ # Suspend and Resume the DUT.
+ self.dut.go_to_sleep()
+ time.sleep(10)
+ self.dut.log.info("Resume the DUT")
+ self.dut.wakeup_screen()
+ wutils.validate_connection(self.dut)
+
+ @test_tracker_info(uuid="d3e34869-f2ae-4614-983d-19be238d8499")
+ def test_connect_to_wpa_psk_ccmp_2g_after_reboot(self):
+ """Test Wi-Fi reconnection after reboot.
+
+ Steps:
+ DUT connect to 2GHz Wi-Fi network.
+ DUT reboot.
+ DUT verify internet connection with HTTP ping.
+ """
+ self.openwrt.log.info("Enable WPA-PSK CCMP on OpenWrt AP")
+ self.openwrt.set_wpa_encryption(OpenWrtWifiSecurity.WPA_PSK_CCMP)
+ wutils.start_wifi_connection_scan_and_ensure_network_found(
+ self.dut, self.wpa_psk_2g[WifiEnums.SSID_KEY])
+ wutils.connect_to_wifi_network(self.dut, self.wpa_psk_2g)
+ self.verify_wpa_network_encryption(OpenWrtWifiSecurity.WPA_PSK_CCMP)
+ # Reboot the DUT.
+ self.dut.log.info("Reboot the DUT")
+ self.dut.reboot()
+ self.dut.wait_for_boot_completion()
+ wutils.wait_for_connect(self.dut,
+ self.wpa_psk_2g[WifiEnums.SSID_KEY])
+ wutils.validate_connection(self.dut)
+
+ @test_tracker_info(uuid="ebd8dd7f-dc36-4e99-b18c-5f725a2f88b2")
+ def test_connect_to_wpa_psk_ccmp_2g_after_incorrect_password(self):
+ """Test Wi-Fi reconnection after incorrect password.
+
+ Steps:
+ DUT connect to 2GHz Wi-Fi network.
+ DUT try to connect to the Wi-Fi network with incorrect password.
+ Connection fail as expected.
+ DUT connect to the Wi-Fi network with correct password.
+ DUT verify internet connection with HTTP ping.
+ """
+ self.openwrt.log.info("Enable WPA-PSK CCMP on OpenWrt AP")
+ self.openwrt.set_wpa_encryption(OpenWrtWifiSecurity.WPA_PSK_CCMP)
+ wutils.start_wifi_connection_scan_and_ensure_network_found(
+ self.dut, self.wpa_psk_2g[WifiEnums.SSID_KEY])
+ self.wpa_psk_2g_fail = self.wpa_psk_2g.copy()
+ self.wpa_psk_2g_fail["password"] = "incorrect_password"
+ # Try to connect a Wi-Fi network with incorrect passwlrd.
+ try:
+ self.dut.log.info("Connect to Wi-Fi with wrong password")
+ wutils.wifi_connect(self.dut, self.wpa_psk_2g_fail, num_of_tries=1)
+ except:
+ self.dut.log.info("Connect to Wi-Fi with correct password")
+ wutils.wifi_connect(self.dut, self.wpa_psk_2g)
+ else:
+ raise signals.TestFailure("DUT connect to Wi-Fi with wrong password")
+ self.verify_wpa_network_encryption(OpenWrtWifiSecurity.WPA_PSK_CCMP)
+ wutils.validate_connection(self.dut)
+
+ @test_tracker_info(uuid="d20fc634-8dcc-4336-9640-2a6907ca1894")
+ def test_connect_to_wpa_psk_ccmp_2g_after_out_of_range(self):
+ """Test Wi-Fi reconnection after out of range.
+
+ Steps:
+ DUT connect to 2GHz Wi-Fi network.
+ DUT out of Wi-Fi range.
+ Make Wi-Fi network is not visible by DUT.
+ DUT back in Wi-Fi range.
+ Wi-Fi network is visible by DUT.
+ DUT connect to the Wi-Fi network.
+ DUT verify internet connection with HTTP ping.
+ """
+ self.openwrt.log.info("Enable WPA-PSK CCMP on OpenWrt AP")
+ self.openwrt.set_wpa_encryption(OpenWrtWifiSecurity.WPA_PSK_CCMP)
+ wutils.start_wifi_connection_scan_and_ensure_network_found(
+ self.dut, self.wpa_psk_2g[WifiEnums.SSID_KEY])
+ wutils.connect_to_wifi_network(self.dut, self.wpa_psk_2g)
+ # Make the DUT out of range.
+ wutils.set_attns(self.attenuators,
+ "atten1_off_atten2_off",
+ self.roaming_attn)
+ wutils.start_wifi_connection_scan_and_ensure_network_not_found(
+ self.dut,
+ self.wpa_psk_2g[WifiEnums.SSID_KEY])
+ # Make the DUT back in range.
+ wutils.set_attns(self.attenuators,
+ "atten1_on_atten2_on",
+ self.roaming_attn)
+ wutils.start_wifi_connection_scan_and_ensure_network_found(
+ self.dut, self.wpa_psk_2g[WifiEnums.SSID_KEY])
+ wutils.connect_to_wifi_network(self.dut, self.wpa_psk_2g)
diff --git a/acts_tests/tests/google/wifi/wifi6/WifiWpa311axTest.py b/acts_tests/tests/google/wifi/wifi6/WifiWpa311axTest.py
new file mode 100644
index 0000000..57ab366
--- /dev/null
+++ b/acts_tests/tests/google/wifi/wifi6/WifiWpa311axTest.py
@@ -0,0 +1,45 @@
+#
+# Copyright 2021 - The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from acts_contrib.test_utils.wifi.WifiBaseTest import WifiBaseTest
+from WifiWpa3OweTest import WifiWpa3OweTest
+
+
+class WifiWpa311axTest(WifiWpa3OweTest):
+ """Tests for WPA3 11ax.
+
+ Test Bed Requirement:
+ One Android device and 1 Asus AXE11000 Access Point.
+ """
+
+ def __init__(self, configs):
+ super().__init__(configs)
+ self.tests = (
+ "test_connect_to_wpa3_personal_2g",
+ "test_connect_to_wpa3_personal_5g",
+ "test_connect_to_wpa3_personal_reconnection"
+ )
+
+ def setup_class(self):
+ WifiBaseTest.setup_class(self)
+
+ self.dut = self.android_devices[0]
+ req_params = ["wifi6_models",]
+ self.unpack_userparams(req_param_names=req_params,)
+ self.ap = self.access_points[0]
+ self.ap.configure_ap({"2g": {"security": "sae"},
+ "5g": {"security": "sae"}})
+ self.wpa3_personal_2g = self.ap.get_wifi_network("2g")
+ self.wpa3_personal_5g = self.ap.get_wifi_network("5g")