Check APF version, VSR API level, and Android version

This commit introduces checks for APF version, VSR API level,
and Android version to decide whether an APFv4 test should be
run, skipped, or fail:
* If Android version is less than V, skip the test
* If VSR API level is greater than or equal to 14 and APF
  version is less than 4, fail the test
* Otherwise, if APF version is less than 4, skip the test

Test: m connectivity_multi_devices_snippet && \
      atest CtsConnectivityMultiDevicesTestCases:ConnectivityMultiDevicesTest
Fix: 352132428
Change-Id: I023164fb59ad40f489abea2e0c45761efc39699b
This commit is contained in:
Junyu Lai 2024-07-11 17:00:29 +08:00
commit 73711f7b41
3 changed files with 34 additions and 4 deletions

View file

@ -23,6 +23,11 @@ class ApfTestBase(multi_devices_test_base.MultiDevicesTestBase):
super().setup_class()
# Check test preconditions.
asserts.abort_class_if(
not self.client.isAtLeastV(),
"Do not enforce the test until V+ since chipset potential bugs are"
" expected to be fixed on V+ releases.",
)
tether_utils.assume_hotspot_test_preconditions(
self.serverDevice, self.clientDevice, UpstreamType.NONE
)
@ -34,13 +39,12 @@ class ApfTestBase(multi_devices_test_base.MultiDevicesTestBase):
)
# Fetch device properties and storing them locally for later use.
client = self.clientDevice.connectivity_multi_devices_snippet
self.server_iface_name, client_network = (
tether_utils.setup_hotspot_and_client_for_upstream_type(
self.serverDevice, self.clientDevice, UpstreamType.NONE
)
)
self.client_iface_name = client.getInterfaceNameFromNetworkHandle(
self.client_iface_name = self.client.getInterfaceNameFromNetworkHandle(
client_network
)
self.server_mac_address = apf_utils.get_hardware_address(

View file

@ -236,7 +236,7 @@ def assume_apf_version_support_at_least(
ad: android_device.AndroidDevice, iface_name: str, expected_version: int
) -> None:
caps = get_apf_capabilities(ad, iface_name)
asserts.skip_if(
asserts.abort_class_if(
caps.apf_version_supported < expected_version,
f"Supported apf version {caps.apf_version_supported} < expected version"
f" {expected_version}",

View file

@ -52,3 +52,4 @@ class MultiDevicesTestBase(base_test.BaseTestClass):
max_workers=2,
raise_on_exception=True,
)
self.client = self.clientDevice.connectivity_multi_devices_snippet