Merge "Screencap more phone infomation when test failed."
diff --git a/acts/framework/acts/controllers/fuchsia_lib/lib_controllers/wlan_controller.py b/acts/framework/acts/controllers/fuchsia_lib/lib_controllers/wlan_controller.py
index 1d202c6..d50f726 100644
--- a/acts/framework/acts/controllers/fuchsia_lib/lib_controllers/wlan_controller.py
+++ b/acts/framework/acts/controllers/fuchsia_lib/lib_controllers/wlan_controller.py
@@ -111,7 +111,12 @@
net_ifaces = self.device.netstack_controller.list_interfaces()
wlan_ifaces_by_role = {'client': {}, 'ap': {}}
for iface in net_ifaces:
- iface_mac = utils.mac_address_list_to_str(iface['mac'])
+ try:
+ # Some interfaces might not have a MAC
+ iface_mac = utils.mac_address_list_to_str(iface['mac'])
+ except Exception as e:
+ self.log.debug(f'Error {e} getting MAC for iface {iface}')
+ continue
if iface_mac in wlan_ifaces_by_mac:
wlan_ifaces_by_mac[iface_mac]['netstack_id'] = iface['id']
diff --git a/acts/framework/acts/controllers/fuchsia_lib/session_manager_lib.py b/acts/framework/acts/controllers/fuchsia_lib/session_manager_lib.py
index 8c4bb55..2593dde 100644
--- a/acts/framework/acts/controllers/fuchsia_lib/session_manager_lib.py
+++ b/acts/framework/acts/controllers/fuchsia_lib/session_manager_lib.py
@@ -33,7 +33,7 @@
"""
try:
self.device.ffx_command(
- "component bind /core/session-manager/session:session")
+ "component start /core/session-manager/session:session")
return {'error': None, 'result': 'Success'}
except Exception as e:
return {'error': e, 'result': None}
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 13838d2..0153087 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
@@ -65,19 +65,22 @@
return True
-def provision_device_for_5g_nsa(log, ads, nr_type=None):
+def provision_device_for_5g_nsa(log, ads, sub_id = None, mmwave = None):
"""Provision Devices for 5G NSA
Args:
log: Log object.
ads: android device object(s).
- nr_type: 'sa' for 5G standalone, 'nsa' for 5G non-standalone, 'mmwave' for 5G millimeter
- wave
+ sub_id: The target SIM for querying.
+ mmwave: True to detect 5G millimeter wave, False to detect sub-6,
+ None to detect both.
Returns:
True: Device(s) are provisioned on 5G NSA
False: Device(s) are not provisioned on 5G NSA
"""
+ sub_id = sub_id if sub_id else ad.droid.subscriptionGetDefaultDataSubId()
+
if isinstance(ads, list):
# Mode Pref
tasks = [(set_preferred_mode_for_5g, [ad]) for ad in ads]
@@ -85,7 +88,7 @@
log.error("failed to set preferred network mode on 5g")
return False
# Attach
- tasks = [(is_current_network_5g_nsa, [ad, nr_type]) for ad in ads]
+ tasks = [(is_current_network_5g_nsa, [ad, sub_id, mmwave]) for ad in ads]
if not multithread_func(log, tasks):
log.error("phone not on 5g")
return False
@@ -95,7 +98,7 @@
set_preferred_mode_for_5g(ads)
# Attach nsa5g
- if not is_current_network_5g_nsa(ads, nr_type):
+ if not is_current_network_5g_nsa(ads, sub_id, mmwave):
ads.log.error("Phone not attached on 5g")
return False
return True
@@ -177,29 +180,35 @@
return True
-def verify_5g_attach_for_both_devices(log, ads, nr_type=None):
+def verify_5g_attach_for_both_devices(log, ads, sub_id = None, nr_type = None,
+ mmwave = None):
"""Verify the network is attached
Args:
log: Log object.
ads: android device object(s).
- nr_type: 'sa' for 5G standalone, 'nsa' for 5G non-standalone, 'mmwave' for 5G millimeter
- wave
+ sub_id: The target SIM for querying.
+ nr_type: 'sa' for 5G standalone, 'nsa' for 5G non-standalone,
+ 'mmwave' for 5G millimeter wave.
+ mmwave: True to detect 5G millimeter wave, False to detect sub-6,
+ None to detect both.
Returns:
True: Device(s) are attached on 5G
False: Device(s) are not attached on 5G NSA
"""
+ sub_id = sub_id if sub_id else ad.droid.subscriptionGetDefaultDataSubId()
+
if nr_type=='sa':
# Attach
- tasks = [(is_current_network_5g_sa, [ad]) for ad in ads]
+ tasks = [(is_current_network_5g_sa, [ad, sub_id, mmwave]) for ad in ads]
if not multithread_func(log, tasks):
log.error("phone not on 5g sa")
return False
return True
else:
# Attach
- tasks = [(is_current_network_5g_nsa, [ad, nr_type]) for ad in ads]
+ tasks = [(is_current_network_5g_nsa, [ad, sub_id, mmwave]) for ad in ads]
if not multithread_func(log, tasks):
log.error("phone not on 5g nsa")
return False
@@ -220,17 +229,22 @@
return set_preferred_network_mode_pref(ad.log, ad, sub_id, mode)
-def provision_device_for_5g_sa(log, ads):
+def provision_device_for_5g_sa(log, ads, sub_id = None, mmwave = None):
"""Provision Devices for 5G SA
Args:
log: Log object.
ads: android device object(s).
+ sub_id: The target SIM for querying.
+ mmwave: True to detect 5G millimeter wave, False to detect sub-6,
+ None to detect both.
Returns:
True: Device(s) are provisioned on 5G SA
False: Device(s) are not provisioned on 5G SA
"""
+ sub_id = sub_id if sub_id else ad.droid.subscriptionGetDefaultDataSubId()
+
if isinstance(ads, list):
# Mode Pref
tasks = [(set_preferred_mode_for_5g, [ad, None, NETWORK_MODE_NR_ONLY]) for ad in ads]
@@ -238,7 +252,7 @@
log.error("failed to set preferred network mode on 5g SA")
return False
- tasks = [(is_current_network_5g_sa, [ad]) for ad in ads]
+ tasks = [(is_current_network_5g_sa, [ad, sub_id, mmwave]) for ad in ads]
if not multithread_func(log, tasks):
log.error("phone not on 5g SA")
return False
@@ -247,46 +261,59 @@
# Mode Pref
set_preferred_mode_for_5g(ads, None, NETWORK_MODE_NR_ONLY)
- if not is_current_network_5g_sa(ads):
+ if not is_current_network_5g_sa(ads, sub_id, mmwave):
ads.log.error("Phone not attached on SA 5g")
return False
return True
-def check_current_network_5g(ad, timeout=30, nr_type=None):
+def check_current_network_5g(
+ ad, sub_id = None, nr_type = None, mmwave = None, timeout = 30):
"""Verifies data network type is on 5G
Args:
ad: android device object.
+ sub_id: The target SIM for querying.
timeout: max time to wait for event
nr_type: 'sa' for 5G standalone, 'nsa' for 5G non-standalone, 'mmwave' for 5G millimeter
- wave
+ wave.
+ mmwave: True to detect 5G millimeter wave, False to detect sub-6,
+ None to detect both.
Returns:
True: if data is on 5g
False: if data is not on 5g
"""
+ sub_id = sub_id if sub_id else ad.droid.subscriptionGetDefaultDataSubId()
+
if nr_type == 'sa':
- if not is_current_network_5g_sa(ad):
+ if not is_current_network_5g_sa(ad, sub_id, mmwave=mmwave):
return False
else:
- if not is_current_network_5g_nsa(ad, nr_type= nr_type, timeout=timeout):
+ if not is_current_network_5g_nsa(ad, sub_id, mmwave=mmwave,
+ timeout=timeout):
return False
return True
-def test_activation_by_condition(ad, from_3g=False, nr_type=None, precond_func=None):
+def test_activation_by_condition(ad, sub_id=None, from_3g=False, nr_type=None,
+ precond_func=None, mmwave=None):
"""Test 5G activation based on various pre-conditions.
Args:
ad: android device object.
+ sub_id: The target SIM for querying.
from_3g: If true, test 5G activation from 3G attaching. Otherwise, starting from 5G attaching.
nr_type: check the band of NR network. Default is to check sub-6.
precond_func: A function to execute pre conditions before testing 5G activation.
+ mmwave: True to detect 5G millimeter wave, False to detect sub-6,
+ None to detect both.
Returns:
If success, return true. Otherwise, return false.
"""
+ sub_id = sub_id if sub_id else ad.droid.subscriptionGetDefaultDataSubId()
+
wifi_toggle_state(ad.log, ad, False)
toggle_airplane_mode(ad.log, ad, False)
if not from_3g:
@@ -313,7 +340,7 @@
ad.log.error("Fail to ensure initial data in 4G")
# 5G attach
ad.log.info("Waiting for 5g NSA attach for 60 secs")
- if is_current_network_5g_nsa(ad, nr_type= nr_type, timeout=60):
+ if is_current_network_5g_nsa(ad, sub_id, mmwave=mmwave, timeout=60):
ad.log.info("Success! attached on 5g NSA")
return True
else:
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 58ce9ee..f35272e 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,140 +19,121 @@
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, nr_type=None, timeout=30):
+def is_current_network_5g_nsa(ad, sub_id = None, mmwave = None, timeout=30):
"""Verifies 5G NSA override network type
Args:
ad: android device object.
- nr_type: 'nsa' for 5G non-standalone, 'mmwave' for 5G millimeter
- wave
+ sub_id: The target SIM for querying.
+ mmwave: True to detect 5G millimeter wave, False to detect sub-6,
+ None to detect both.
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()
- if nr_type == 'mmwave':
- nsa_band = OverrideNetworkContainer.OVERRIDE_NETWORK_TYPE_NR_MMWAVE
- elif nr_type == 'nsa':
- nsa_band = OverrideNetworkContainer.OVERRIDE_NETWORK_TYPE_NR_NSA
+ sub_id = sub_id if sub_id else ad.droid.subscriptionGetDefaultDataSubId()
+
+ def _nsa_display_monitor(ad, sub_id, mmwave, timeout):
+ ad.ed.clear_events(EventDisplayInfoChanged)
+ ad.droid.telephonyStartTrackingDisplayInfoChangeForSubscription(sub_id)
+ if mmwave:
+ nsa_band = OverrideNetworkContainer.OVERRIDE_NETWORK_TYPE_NR_MMWAVE
+ else:
+ nsa_band = OverrideNetworkContainer.OVERRIDE_NETWORK_TYPE_NR_NSA
+ try:
+ event = ad.ed.wait_for_event(
+ EventDisplayInfoChanged,
+ ad.ed.is_event_match,
+ timeout=timeout,
+ field=DisplayInfoContainer.OVERRIDE,
+ value=nsa_band)
+ ad.log.info("Got expected event %s", event)
+ return True
+ except Empty:
+ ad.log.info("No event for display info change with <%s>", nsa_band)
+ ad.screenshot("5g_nsa_icon_checking")
+ return False
+ finally:
+ ad.droid.telephonyStopTrackingServiceStateChangeForSubscription(
+ sub_id)
+
+ if mmwave is None:
+ return _nsa_display_monitor(
+ ad, sub_id, mmwave=False, timeout=timeout) or _nsa_display_monitor(
+ ad, sub_id, mmwave=True, timeout=timeout)
else:
- nsa_band = OverrideNetworkContainer.OVERRIDE_NETWORK_TYPE_NR_NSA
- try:
- event = ad.ed.wait_for_event(
- EventDisplayInfoChanged,
- ad.ed.is_event_match,
- timeout=timeout,
- field=DisplayInfoContainer.OVERRIDE,
- value=nsa_band)
- ad.log.info("Got expected event %s", event)
- return True
- except Empty:
- ad.log.info("No event for display info change")
- ad.screenshot("5g_nsa_icon_checking")
- return False
- finally:
- ad.droid.telephonyStopTrackingDisplayInfoChange()
- return None
+ return _nsa_display_monitor(ad, sub_id, mmwave, timeout)
-def is_current_network_5g_nsa_for_subscription(ad, nr_type=None, timeout=30, sub_id=None):
- """Verifies 5G NSA override network type for subscription id.
- Args:
- ad: android device object.
- nr_type: 'nsa' for 5G non-standalone, 'mmwave' for 5G millimeter wave
- 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, nr_type=nr_type)
-
- voice_sub_id_changed = False
- current_sub_id = ad.droid.subscriptionGetDefaultVoiceSubId()
- if current_sub_id != sub_id:
- ad.droid.subscriptionSetDefaultVoiceSubId(sub_id)
- voice_sub_id_changed = True
-
- result = is_current_network_5g_nsa(ad, nr_type=nr_type)
-
- if voice_sub_id_changed:
- ad.droid.subscriptionSetDefaultVoiceSubId(current_sub_id)
-
- return result
-
-
-def is_current_network_5g_sa(ad):
+def is_current_network_5g_sa(ad, sub_id = None, mmwave = None):
"""Verifies 5G SA override network type
Args:
ad: android device object.
+ sub_id: The target SIM for querying.
+ mmwave: True to detect 5G millimeter wave, False to detect sub-6,
+ None to detect both.
Returns:
True: if data is on 5g SA
False: if data is not on 5g SA
"""
- network_connected = ad.droid.telephonyGetCurrentDataNetworkType()
- if network_connected == 'NR':
- ad.log.debug("Network is currently connected to %s", network_connected)
- return True
- else:
- ad.log.error("Network is currently connected to %s, Expected on NR", network_connected)
- ad.screenshot("5g_sa_icon_checking")
+ sub_id = sub_id if sub_id else ad.droid.subscriptionGetDefaultDataSubId()
+ current_rat = ad.droid.telephonyGetCurrentDataNetworkTypeForSubscription(
+ sub_id)
+ # TODO(richardwychang): check SA MMWAVE when function ready.
+ sa_type = ['NR',]
+ if mmwave is None:
+ if current_rat in sa_type:
+ ad.log.debug("Network is currently connected to %s", current_rat)
+ return True
+ else:
+ ad.log.error(
+ "Network is currently connected to %s, Expected on %s",
+ current_rat, sa_type)
+ ad.screenshot("5g_sa_icon_checking")
+ return False
+ elif mmwave:
+ ad.log.error("SA MMWAVE currently not support.")
return False
+ else:
+ if current_rat == 'NR':
+ ad.log.debug("Network is currently connected to %s", current_rat)
+ return True
+ else:
+ ad.log.error(
+ "Network is currently connected to %s, Expected on NR",
+ current_rat)
+ ad.screenshot("5g_sa_icon_checking")
+ return False
-def is_current_network_5g(ad, nr_type=None, timeout=30):
+def is_current_network_5g(ad, sub_id = None, nr_type = None, mmwave = None,
+ timeout = 30):
"""Verifies 5G override network type
Args:
ad: android device object
- nr_type: 'sa' for 5G standalone, 'nsa' for 5G non-standalone, 'mmwave' for 5G millimeter
- wave
+ sub_id: The target SIM for querying.
+ nr_type: 'sa' for 5G standalone, 'nsa' for 5G non-standalone.
+ mmwave: True to detect 5G millimeter wave, False to detect sub-6,
+ None to detect both.
timeout: max time to wait for event.
Returns:
True: if data is on 5G regardless of SA or NSA
False: if data is not on 5G refardless of SA or NSA
"""
+ sub_id = sub_id if sub_id else ad.droid.subscriptionGetDefaultDataSubId()
+
if nr_type == 'nsa':
- return is_current_network_5g_nsa(ad, nr_type = 'nsa', timeout=timeout)
+ return is_current_network_5g_nsa(
+ ad, sub_id=sub_id, mmwave=mmwave, timeout=timeout)
elif nr_type == 'sa':
- return is_current_network_5g_sa(ad)
- elif nr_type == 'mmwave':
- return is_current_network_5g_nsa(ad, nr_type = 'mmwave', timeout=timeout)
+ return is_current_network_5g_sa(ad, sub_id=sub_id, mmwave=mmwave)
else:
- return is_current_network_5g_nsa(ad, nr_type=None) or is_current_network_5g_sa(ad)
-
-
-def is_current_network_5g_for_subscription(ad, sub_id=None, nr_type=None):
- """Verifies 5G override network type for subscription id.
- Args:
- ad: android device object
- sub_id: subscription id
- nr_type: 'sa' for 5G standalone, 'nsa' for 5G non-standalone, 'mmwave' for 5G millimeter
- wave
-
- Returns:
- True: if data is on 5G regardless of NSA or SA.
- False: if data is not on 5G regardless of NSA or SA.
- """
- if not sub_id:
- return is_current_network_5g(ad, nr_type=nr_type)
-
- voice_sub_id_changed = False
- current_sub_id = ad.droid.subscriptionGetDefaultVoiceSubId()
- if current_sub_id != sub_id:
- ad.droid.subscriptionSetDefaultVoiceSubId(sub_id)
- voice_sub_id_changed = True
-
- result = is_current_network_5g(ad, nr_type=nr_type)
-
- if voice_sub_id_changed:
- ad.droid.subscriptionSetDefaultVoiceSubId(current_sub_id)
-
- return result
+ return is_current_network_5g_nsa(
+ ad, sub_id=sub_id, mmwave=mmwave,
+ timeout=timeout) or is_current_network_5g_sa(
+ ad, sub_id=sub_id, mmwave=mmwave)
diff --git a/acts_tests/acts_contrib/test_utils/tel/tel_data_utils.py b/acts_tests/acts_contrib/test_utils/tel/tel_data_utils.py
index 64f3b55..05808f9 100644
--- a/acts_tests/acts_contrib/test_utils/tel/tel_data_utils.py
+++ b/acts_tests/acts_contrib/test_utils/tel/tel_data_utils.py
@@ -527,7 +527,7 @@
return False
if nw_gen == GEN_5G:
- if not check_current_network_5g(ad, timeout=60, nr_type=nr_type):
+ if not check_current_network_5g(ad, nr_type=nr_type, timeout=60):
return False
else:
if not is_droid_in_network_generation_for_subscription(
@@ -876,7 +876,7 @@
ensure_phones_idle(log, ad_list)
if nw_gen == GEN_5G:
- if not provision_device_for_5g(log, android_devices, nr_type= nr_type):
+ if not provision_device_for_5g(log, android_devices, nr_type=nr_type):
return False
elif nw_gen:
if not ensure_network_generation_for_subscription(
@@ -1032,7 +1032,7 @@
ensure_phones_idle(log, clients)
wifi_toggle_state(log, provider, False)
if network_generation == RAT_5G:
- if not provision_device_for_5g(log, provider, nr_type= nr_type):
+ if not provision_device_for_5g(log, provider, nr_type=nr_type):
return False
elif network_generation:
if not ensure_network_generation(
@@ -1102,7 +1102,7 @@
return False
if provider_setup_func == RAT_5G:
- if not provision_device_for_5g(log, provider, nr_type= nr_type):
+ if not provision_device_for_5g(log, provider, nr_type=nr_type):
return False
try:
log.info("1. Setup WiFi Tethering.")
@@ -1249,7 +1249,7 @@
wait_time_in_call)
if nw_gen == GEN_5G:
- if not provision_device_for_5g(log, ads[0], nr_type= nr_type):
+ if not provision_device_for_5g(log, ads[0], nr_type=nr_type):
return False
elif nw_gen:
if not ensure_network_generation(log, ads[0], nw_gen,
@@ -1304,7 +1304,8 @@
return False
# Disable airplane mode if test under apm on.
toggle_airplane_mode(log, ads[0], False)
- if nw_gen == GEN_5G and not check_current_network_5g(ads[0], nr_type= nr_type):
+ if nw_gen == GEN_5G and not check_current_network_5g(ads[0],
+ nr_type=nr_type):
ads[0].log.error("Phone not attached on 5G after call.")
return False
return True
@@ -1335,7 +1336,7 @@
False if failed.
"""
if nw_gen == GEN_5G:
- if not provision_device_for_5g(log, ads[0], nr_type= nr_type):
+ if not provision_device_for_5g(log, ads[0], nr_type=nr_type):
return False
elif nw_gen:
if not ensure_network_generation(log, ads[0], nw_gen,
@@ -1382,7 +1383,8 @@
ad_download.force_stop_apk("com.google.android.youtube")
# Disable airplane mode if test under apm on.
toggle_airplane_mode(log, ads[0], False)
- if nw_gen == GEN_5G and not check_current_network_5g(ads[0], nr_type= nr_type):
+ if nw_gen == GEN_5G and not check_current_network_5g(ads[0],
+ nr_type=nr_type):
ads[0].log.error("Phone not attached on 5G after call.")
result = False
return result
@@ -1452,7 +1454,8 @@
time.sleep(WAIT_TIME_ANDROID_STATE_SETTLING)
- if nw_gen == GEN_5G and not verify_5g_attach_for_both_devices(log, ads, nr_type= nr_type):
+ if nw_gen == GEN_5G and not verify_5g_attach_for_both_devices(
+ log, ads, nr_type=nr_type):
log.error("Phone not attached on 5G after epdg call.")
return False
@@ -1553,7 +1556,7 @@
ssid=None,
password=None,
pre_teardown_func=None,
- nr_type= None):
+ nr_type=None):
"""WiFi Tethering test
Args:
log: log object.
@@ -1579,7 +1582,7 @@
nr_type: NR network type e.g. NSA, SA, MMWAVE.
"""
- if not test_setup_tethering(log, provider, clients, nw_gen, nr_type= nr_type):
+ if not test_setup_tethering(log, provider, clients, nw_gen, nr_type=nr_type):
log.error("Verify %s Internet access failed.", nw_gen)
return False
@@ -1880,7 +1883,7 @@
provider,
clients,
new_gen=None,
- nr_type= None):
+ nr_type=None):
"""Verify toggle Data network during WiFi Tethering.
Args:
log: log object.
@@ -1905,7 +1908,7 @@
check_iteration=2,
do_cleanup=False,
ssid=ssid,
- nr_type= nr_type):
+ nr_type=nr_type):
log.error("WiFi Tethering failed.")
return False
if not provider.droid.wifiIsApEnabled():
diff --git a/acts_tests/acts_contrib/test_utils/tel/tel_phone_setup_utils.py b/acts_tests/acts_contrib/test_utils/tel/tel_phone_setup_utils.py
index f9e1712..6077d9c 100644
--- a/acts_tests/acts_contrib/test_utils/tel/tel_phone_setup_utils.py
+++ b/acts_tests/acts_contrib/test_utils/tel/tel_phone_setup_utils.py
@@ -50,7 +50,7 @@
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_DISABLED
from acts_contrib.test_utils.tel.tel_defines import WFC_MODE_CELLULAR_PREFERRED
-from acts_contrib.test_utils.tel.tel_5g_utils import is_current_network_5g_for_subscription
+from acts_contrib.test_utils.tel.tel_5g_utils import is_current_network_5g
from acts_contrib.test_utils.tel.tel_ims_utils import toggle_volte
from acts_contrib.test_utils.tel.tel_ims_utils import toggle_volte_for_subscription
from acts_contrib.test_utils.tel.tel_ims_utils import set_wfc_mode
@@ -753,8 +753,7 @@
nr_type: NR network type e.g. NSA, SA, MMWAVE
"""
if nw_gen == GEN_5G:
- if not is_current_network_5g_for_subscription(ad, sub_id=sub_id,
- nr_type=nr_type):
+ if not is_current_network_5g(ad, sub_id=sub_id, nr_type=nr_type):
ad.log.error("Not in 5G coverage.")
return False
else:
@@ -839,7 +838,7 @@
nw_gen: GEN_4G or GEN_5G
"""
if nw_gen == GEN_5G:
- if not is_current_network_5g_for_subscription(ad, sub_id=sub_id, nr_type=nr_type):
+ if not is_current_network_5g(ad, sub_id=sub_id, nr_type=nr_type):
ad.log.error("Not in 5G coverage.")
return False
else:
@@ -1406,8 +1405,7 @@
return True
if (generation == GEN_5G) or (generation == RAT_5G):
- if is_current_network_5g_for_subscription(ad, sub_id=sub_id,
- nr_type=nr_type):
+ if is_current_network_5g(ad, sub_id=sub_id, nr_type=nr_type):
ad.log.info("Current network type is 5G.")
return True
else:
@@ -1532,7 +1530,7 @@
nr_type=None):
if generation == GEN_5G:
- if is_current_network_5g_for_subscription(ad, sub_id=sub_id, nr_type=nr_type):
+ if is_current_network_5g(ad, sub_id=sub_id, nr_type=nr_type):
ad.log.info("Current network type is 5G.")
return True
else:
diff --git a/acts_tests/tests/google/net/ApfCountersTest.py b/acts_tests/tests/google/net/ApfCountersTest.py
index dd73bdb..d2eeff3 100755
--- a/acts_tests/tests/google/net/ApfCountersTest.py
+++ b/acts_tests/tests/google/net/ApfCountersTest.py
@@ -75,7 +75,9 @@
# install scapy
current_dir = os.path.dirname(os.path.realpath(__file__))
send_ra = os.path.join(current_dir, RA_SCRIPT)
- send_scapy = getattr(self, "scapy", os.path.join(current_dir, SCAPY))
+ send_scapy = os.path.join(current_dir, SCAPY)
+ if hasattr(self, "scapy"):
+ send_scapy = self.scapy[0]
self.access_points[0].install_scapy(send_scapy, send_ra)
self.tcpdump_pid = None