Commit graph android_packages_modules_Co.../tests/cts
Message SHA1
Refactor: apply pyformat for coding style consistency
add pyformat for presubmit hook

Flag: EXEMPT mainline
Bug: 419423721
Test: atest CtsConnectivityMultiDevicesTestCases
Change-Id: I9abc5cee454e8c8e21ce7e3c134145857680251f

Jimi Chen   commited 2025-05-28 12:44:57 +00:00
dcbe9b403d
Merge "Assumption check should not affect ethernet enabled state" into main
Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-05-22 10:28:59 -07:00
2e62f8a623
Assumption check should not affect ethernet enabled state
setEthernetEnabled() is used as a synchronization mechanism, so don't
let it affect enabled state.

Test: TH
Flag: EXEMPT test
Bug: 10000001
Change-Id: Ib023b7f944a8a84435dcc546aced9b0eab96d364

Patrick Rohr   commited 2025-05-22 10:28:21 -07:00
49c3c92a44
Merge "Ensure requestTetheredInterface() is processed before proceeding" into main
Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-05-22 10:28:00 -07:00
d3295c8747
Delete old BPF compat tests for previous SDKs
R & V+ never needed this as there is no platform
loading of mainline bpf.

On T/U we've been loading via mainline NetBpfLoad
for the past year, so the struct sizes only actually
matter for S.

S switches to mainline NetBpfLoad in M-2025-05
(currently in small canary), at which point the
struct sizes stop mattering.

In M-2025-07 S/T/U still look at the 'min bpf loader'
section of the .o, but don't go any deeper.

In M-2025-08 we no longer ship any bpf .o
files that need to be parsed by platform
bpfloader (as they're in a different subdirectory
in the tethering apex they don't even look in).

Test: TreeHugger
Flag: EXEMPT test deletion
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I72b9ebcf4ea59e61cdfd8bb009ede13670e3421f

Maciej Żenczykowski   commited 2025-05-22 02:08:43 -07:00
e8cba91fd5
Skip APF enforcement check on Wear OS for 25Q2 devices.
This commit adjusts the APF enforcement logic to align with 25Q2 GMS-VSR
and GTVS requirements. APFv6 is currently applicable only to handheld
and tablet devices (GMS-VSR) and TV devices (GTVS). For Wear OS devices,
APF enforcement will commence with Wear OS 7; therefore, the APF
enforcement check is skipped for devices launched/upgraded on Wear OS in 25Q2.

Bug: 381819368
Test: TH
Flag: EXEMPT bugfix
Change-Id: I4224738d9658fb4f6b67e491e7cd7d78e9b48748

Yuyang Huang   commited 2025-05-22 12:55:45 +09:00
aceedde4a1
Ensure requestTetheredInterface() is processed before proceeding
requestTetheredInterface() only returns a callback if an interface for
tethering is available. The previous code timed out after 500ms which
was not enough for some devices. Instead of increasing the timeout, this
change calls setEthernetEnabled() which triggers a callback as soon as
it was processed on the handler thread. Since this event is guaranteed
to be processed after requestTetheredInterface(), the subsequent
expectOnAvailable() does not have to wait at all.

Test: TH
Flag: EXEMPT test
Bug: 418151132
Change-Id: Iff119a8e425d4071bf63fe92815061c7eb36848a

Patrick Rohr   commited 2025-05-21 14:12:31 -07:00
3556c3d7b1
Remove RecorderCallback.
This class doesn't actually serve a purpose, it only makes
TestableNetworkCallbck more complex.

Test: CtsNetTestCases ConnectivityCoverageTests
Flag: EXEMPT test-only
Change-Id: I39a598b82a3215384bdfe04980f4b280ab2c2716

Chalard Jean   commited 2025-05-19 16:35:53 +09:00
f2994122c1
Merge "Move SSLCertificateSocketFactoryTest out of CtsNetTestCases" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-16 04:01:55 -07:00
68d8a44bcf
Merge "Backfill new field host_commong_data" into main
Julien Desprez   authored and   Android (Google) Code Review   commited 2025-05-15 10:06:47 -07:00
6c6dfd7be0
Merge changes I62a9d0a1,Ie50b2f35 into main
* changes:
  Don't ignore exceptions in NsdManagerDownstreamTetheringTest
  Don't warn in tests for deprecation

Jean Chalard   authored and   Android (Google) Code Review   commited 2025-05-15 00:05:56 -07:00
43aa539935
Move SSLCertificateSocketFactoryTest out of CtsNetTestCases
Problem:
- SSLCertificateSocketFactory has a bug causing socket leaks in
  certain exception scenarios.
- SSLCertificateSocketFactoryTest triggers this, leading to
  leaked sockets during test runs.
- When run within CtsNetTestCases, the network traffic from these
  leaked sockets interferes with
  TrafficStatsTest#testTrafficStatsForLocalhost, which monitors
  traffic by UID within that same suite.
- This interference causes TrafficStatsTest to be flaky.

Solution:
- Moving SSLCertificateSocketFactoryTest to a different suite
  ensures its leaked socket traffic is no longer associated with
  the same UID context monitored by TrafficStatsTest.
- This isolation prevents the test interference and resolves the
  flakiness.

Flag: TEST_ONLY
Test: atest CtsLibcoreNetTestCases
Bug: 393471251
Change-Id: I1cc626ba281939999a7d6978668eefea8531ffec

Junyu Lai   commited 2025-05-15 15:04:24 +08:00
a8f2ea5b37
Merge "add new host_common_data tag in addition to host_required" into main
Julien Desprez   authored and   Android (Google) Code Review   commited 2025-05-14 20:05:03 -07:00
0476e06f2a
add new host_common_data tag in addition to host_required
This enables the proper packaging of the dependency along with the test module rather than maintaining a manual mapping the CI infrastructure. The new field introduced in Soong is the right field to properly declare  a host side dependency for a device-test (b/262397555)

Test: presubmit
Bug: 413525819
Flag: TEST_ONLY
Change-Id: If103e32632e4312460d99abd2a5c5b00e877f8ac

Julien Desprez   commited 2025-05-14 20:02:46 -07:00
b7d0a59107
Don't ignore exceptions in NsdManagerDownstreamTetheringTest
tryTest{} catches and returns and must be ended with a cleanup{}
block to throw. That is why it's marked with @CheckReturnValue.
The IDE marks the entire block as a huge warning.

Ideally this should really be an error, but that flag only exists
in Kotlin 2.2 and above, which is not out of beta yet, so
add a TODO in the bp file

Test: NsdManagerDownstreamTetheringTest
Flag: EXEMPT test-only
Change-Id: I62a9d0a16926574eb286d45b61d4d5d2e8c870ab

Chalard Jean   commited 2025-05-15 09:04:02 +09:00
ebaef1230b
Remove deprecated SC_V2 constant
Test: TH
Flag: EXEMPT test-only
Change-Id: I3444fad305f49294ed8c3a850b631f385678c117

Chalard Jean   commited 2025-05-15 09:03:59 +09:00
9373e3442e
Backfill new field host_commong_data
This new field ensures that the dependence is properly packaged with the module.
(original context: b/262397555)

Test: presubmit
Bug: 413525819
Flag: TEST_ONLY
Change-Id: Ifca931a4ee7fa671f2316ae731b207404a8edd3d

Julien Desprez   commited 2025-05-14 13:23:36 -07:00
33b48e47c6
Disallow the legacy tether API for Wi-Fi.
AOSP code has never used this API, and metrics from production
show no usage either. Removing it will allow simplifying the
code.

This CL removes testRequestStaticIpLegacyTether because it makes
legacyTether a no-op and there is already a test for static IP
request right above it.

Bug: 408087033
Flag: EXEMPT dead code
Test: updated existing tests
Change-Id: Ib94ed0860ab57abfd9fc7bdfdc911f5ab57003ed

Lorenzo Colitti   commited 2025-05-13 19:43:58 +09:00
bec4b5b8d4
Merge "Revert "Set the owners to look at the same branch not to be fixed to main."" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-05-12 11:07:01 -07:00
8baa85d1ca
Revert "Set the owners to look at the same branch not to be fixed to main."
This reverts commit 9d9bc48f7d.

Reason for revert: Not wanted.

Change-Id: I9034d696ab72fa63d220e630786c243065f99292

Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-05-12 11:06:19 -07:00
cbbaaf12de
Merge changes Iad43a122,Icdefa89f into main
* changes:
  Skip ApfIntegrationTest on automotive devices
  Enforce valid APF versions (0, 2, 3, 4, 6000, 6100)

Yuyang Huang   authored and   Android (Google) Code Review   commited 2025-05-12 08:34:00 -07:00
b2e2674a44
Merge "Revert "Completely disable flaky APF multidevice CTS class"" into main
Yuyang Huang   authored and   Android (Google) Code Review   commited 2025-05-12 08:30:50 -07:00
cd68f72130
Merge "Skip APFv6 enforcement check on Wear OS devices in 25Q2" into main
Yuyang Huang   authored and   Android (Google) Code Review   commited 2025-05-12 08:11:22 -07:00
abae1f977e
Set the owners to look at the same branch not to be fixed to main.
Flag: EXEMPT owners only
BUG=408508431

Change-Id: I0e5e2dcb7b23e4a0e12cee1b3befdc860b8f1781

Sam Saccone   commited 2025-05-12 07:52:34 -07:00
9d9bc48f7d
Skip ApfIntegrationTest on automotive devices
This commit modifies ApfIntegrationTest to skip execution on automotive
devices. APF GMS-VSR requirements do not apply to automotive devices.
APF offer no power benefit automotive devices due to their almost
infinite battery power supply. This change aligns the test suite with
the platform's specific requirements.

Test: TH
Flag: EXEMPT bugfix
Change-Id: Iad43a122407fe438cab94f59ed8aba8d6080af02

Yuyang Huang   commited 2025-05-12 23:00:36 +09:00
8e5a4fb2c0
Enforce valid APF versions (0, 2, 3, 4, 6000, 6100)
This commit adds a check to enforce that reported APF versions are
either 0 (indicating no support) or one of the officially valid
versions: 2, 3, 4, 6000 or 6100. This ensures consistency and prevents
issues arising from device using unsupported APF versions.

Test: TH
Flag: EXEMPT bugfix
Change-Id: Icdefa89fae590ec78146df4cbd2c683b5d8258f7

Yuyang Huang   commited 2025-05-12 22:21:58 +09:00
6807d2dd39
Skip APFv6 enforcement check on Wear OS devices in 25Q2
This commit adjusts the APFv6 enforcement logic to align with 25Q2
GMS-VSR and GTVS requirements. APFv6 is currently applicable only to
handheld and tablet devices (GMS-VSR) and TV devices (GTVS). For Wear OS
devices, APFv6 enforcement is deferred until specific requirements are
officially incorporated; thus, the enforcement check is skipped.

Bug: 415732337
Test: TH
Flag: EXEMPT bugfix
Change-Id: I838a96f3f214d8e46895484f836ade2588a335db

Yuyang Huang   commited 2025-05-12 22:17:37 +09:00
d0030fc967
Merge "Build CtsNetTestCases against API" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-12 00:50:20 -07:00
8d7c927e6a
Merge "Remove last @hide usage in CtsNetTestCases" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-11 19:48:00 -07:00
643c401087
Merge "Extend QosFilter address matching function" into main
Sewook Seo   authored and   Android (Google) Code Review   commited 2025-05-09 01:02:33 -07:00
ceb29e6cdf
Build CtsNetTestCases against API
Instead of building against hidden API, build against module API.

This does not build against test API as test API does not contain module
API stubs, and this test uses more module APIs than test APIs.

Building against stubs should make the build faster (no need to build
all of framework.jar), and is desirable in CTS to avoid depending on
methods that may change over time or be modified by OEMs.

Test: atest
Flag: TEST_ONLY
Bug: 410435307
Change-Id: I2ac80daa144416cab5477843ecf32041fe0882c5

Remi NGUYEN VAN   commited 2025-05-09 16:56:37 +09:00
0c3142bdce
Remove last @hide usage in CtsNetTestCases
Inline the last remaining constants, and add a workaround for test APIs
that are missing in module API stubs.

While inlining the constants and reflection usage is far from ideal,
this is effectively what the tests are doing today, and it allows
preventing further usage of hidden API in the tests by making them build
against API stubs (in subsequent change).

Test: atest
Flag: TEST_ONLY
Bug: 410435307
Change-Id: Id2ffc0cb41bc31e4cd049b711a392904910414a3

Remi NGUYEN VAN   commited 2025-05-09 16:56:37 +09:00
1e66940f0b
Extend QosFilter address matching function
Extend QosFilter address match function for IP address range based on
prefix length.

Bug: 406146808
Bug: 399960748
Flag: com.android.net.flags.qos_filter_ip_range_matching
Test: atest CtsNetTestCases
Test: atest ConnectivityCoverageTests
Change-Id: I78d995fda111d258da9a912c7afa5e472e43437f

Sewook Seo   commited 2025-05-08 22:37:32 -07:00
6305252415
Merge changes Ia7691368,I802541ae into main
* changes:
  Remove most hidden API usage in net CTS
  Hardcode the setting for multipath preference

Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-08 21:49:24 -07:00
28d9001a20
Merge "Remove SSLCertificateSocketFactoryTest @hide usage" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-07 04:02:36 -07:00
8c79c399da
Merge "Fix for timing issue for handling user interaction addExternalApprover" into main
Paul Hu   authored and   Android (Google) Code Review   commited 2025-05-07 02:48:27 -07:00
8014cfea1e
Fix for timing issue for handling user interaction addExternalApprover
If client knows network name and passphrase, it can connect to the
server (Group owner) without user interaction. In this case, it needs
to use interface address of group owner, not device address

Bug: 408245757
Test: atest CtsConnectivityMultiDevicesTestCases
Flag: EXEMPT bug fix
Change-Id: I47bc8609e63564f4226a4ef71ea9e382f5f919fe
Signed-off-by: Rohit Kothari <r.kothari@samsung.corp-partner.google.com>

Rohit Kothari   authored and   Paul Hu   commited 2025-05-07 02:47:38 -07:00
50b479097d
Remove SSLCertificateSocketFactoryTest @hide usage
Include verifyHostname in the test instead of calling the hidden API.

This removes a bit of coverage as verifyHostname itself is not tested
anymore, but it still verifies behavior of the verification and state of
the SSL session on socket creation.

verifyHostname is @hide API so it should not be exercised directly by
CTS.

Bug: 410435307
Flag: TEST_ONLY
Test: atest

Change-Id: I11f56e21ba242b7fcc5b84f6de992dc94d90ddee

Remi NGUYEN VAN   authored and   Junyu Lai   commited 2025-05-07 17:21:26 +08:00
145dc19675
Merge "Skip network requests in MultinetworkApiTest for instant mode" into main
Paul Hu   authored and   Android (Google) Code Review   commited 2025-05-06 23:06:32 -07:00
af00e59dfc
Increase timeout to wait for Bluetooth to be enabled
Bug: 415541761
Flag: EXEMPT mainline
Test: yes
Change-Id: I2a9aa900802cd7801908cffe3fa801ff4c0bfb56

Patrick Rohr   commited 2025-05-06 09:43:08 -07:00
a48d4b8cdb
Skip network requests in MultinetworkApiTest for instant mode
MultinetworkApiTest would attempt to request cellular and Wi-Fi
network connections in test setup. This requires the
CHANGE_NETWORK_STATE permission, which is not granted to
the instant app. Therefore, skip the network requests if the
tests are running in instant mode.

Bug: 413261962
Test: atest android.net.cts.MultinetworkApiTest --instant
Flag: EXEMPT bug fix
Change-Id: I64366a4f2528402d3050adb54bb0aea352c53088

Paul Hu   commited 2025-05-06 02:39:52 +00:00
37c39d0af6
Merge "Add NET_CAPABILITY_NOT_RESTRICTED to test network in CtsNetUtils" into main
Jacque Li   authored and   Android (Google) Code Review   commited 2025-05-01 08:39:26 -07:00
d36772174f
Merge "Add connectivity pre-check for CtsHostsideNetworkTests" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-04-30 02:45:52 -07:00
407cd52ca1
Add connectivity pre-check for CtsHostsideNetworkTests
Test: atest CtsHostsideNetworkTests
Flag: TEST_ONLY
Change-Id: If7f8cd614f0528248ca87be1d3aac5396b64e071

Paul Hu   commited 2025-04-30 01:14:24 -07:00
882a44f978
Add NET_CAPABILITY_NOT_RESTRICTED to test network in CtsNetUtils
Bug: 404377608
Flag: TEST_ONLY
Test: atest CtsNetTestCases
Change-Id: I594de55622d20d6fe178d121472d95b92c611ee4

Jacque Li   commited 2025-04-29 20:14:27 -04:00
d161f1dcf1
Merge changes Iabc2fad0,I2078330b into main
* changes:
  Improve TestableNetworkOfferCallback
  Add a way to poll with a position for ReadHead

Jean Chalard   authored and   Android (Google) Code Review   commited 2025-04-27 23:25:04 -07:00
74dcb4637c
Merge changes I579b3cd9,Ib008e63c into main
* changes:
  Allow QuicConnectionCloser to close loopback QUIC connection
  Enable QUIC connection close by default in ConnectivityService

Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-04-27 22:20:38 -07:00
5ae058b9d4
Enable QUIC connection close by default in ConnectivityService
This feature will be controlled by the caller.
Cronet calls the register/unregisterQuicConnectionClosePayload APIs only
when the Chromium experiment flag is enabled
(http://crrev.com/c/6421621/).

This CL also updates testRegisterQuicConnectionClosePayload
to be skipped on U or older releases since FIREWALL_CHAIN_BACKGROUND is
supported on V or higher releases.

Flag: EXEMPT guarded by chromium flag
Bug: 311792075
Test: TH
Change-Id: Ib008e63c585cfe8775b25783cd55b0873bb5e2f0

Motomu Utsumi   commited 2025-04-28 12:52:58 +09:00
2ea5939672
Add a way to poll with a position for ReadHead
It was thought originally that it would not make a lot of sense to
offer such a call, but with usage it became clear that there is a
simple, obvious and useful behavior.
In particular this is very useful to mix eventuallyExpect and
expect calls. Interestingly, before this patch, calling
callback.eventuallyExpect<...>()
callback.expect<...>()
does not actually behave like you would intuitively think, because
eventuallyExpect does not advance the read head. When this
utility was made we thought this was the better behavior, but
usage has shown that advancing is both obvious and more useful.

Astonishingly, there seem to be no caller who needs to
eventuallyExpect() and later expect(), meaning that this
behavior change is apparently fine.

Test: ConnectivityCoverageTest and treehugger
Flag: EXEMPT test-only change
Change-Id: I2078330bd913cf0f75240bf3d4852e487e3e0163

Chalard Jean   commited 2025-04-27 15:54:33 +09:00
a14fb7cf79
Revert "Completely disable flaky APF multidevice CTS class"
This reverts commit 5d3dc48289.

Reason for revert: target for 25Q4

Bug: 406570694
Change-Id: I124d7bcb2a09cab2d825042814adb262fd2e50cf

Yuyang Huang   authored and   Android (Google) Code Review   commited 2025-04-24 03:02:15 -07:00
9bca06aa43