Commit graph android_packages_modules_Co.../tests
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 "Truncate the additional records if the packet is too large" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-23 01:01:05 -07:00
f79d1bd53d
Truncate the additional records if the packet is too large
When the packet is too large to be sent it may cause the socket to throw
an error. This commit truncates the additional records in this case.

Bug: 407609792
Test: CI
Flag: EXEMPT bugfix

Change-Id: I77a979d7f8799f05cbcb14857061a18aecfef657

Handa Wang   commited 2025-05-22 21:38:55 -07:00
8f8c78d56f
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
Merge "Skip APF enforcement check on Wear OS for 25Q2 devices." into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-05-22 01:49:53 -07:00
efc519790b
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
Revert^2 "Check whether CarrierConfigManager is null"
This reverts commit 7b7cfa45a6.

Reason for revert: prevents crash with no carrierConfigManager support
Test: atest ConnectivityCoverageTests

Change-Id: I9e91d2d25d16c0c2a39388f08a49bef7b17fda42

Jimi Chen   commited 2025-05-21 07:24:00 +00:00
232c944de3
Merge "Revert "Check whether CarrierConfigManager is null"" into main
Priyanka Advani (xWF)   authored and   Android (Google) Code Review   commited 2025-05-20 14:22:25 -07:00
730bb0bfe9
Revert "Check whether CarrierConfigManager is null"
This reverts commit b936f0c5fd.

Reason for revert: Droidmonitor created revert due to b/418898788. Will be verifying through ABTD before submission.

Fix: 418898788
Change-Id: Ia47f0cc9a33ed33f9d53064878992081a792f1ad

Priyanka Advani (xWF)   authored and   Android (Google) Code Review   commited 2025-05-20 11:19:03 -07:00
7b7cfa45a6
Merge "Remove RecorderCallback." into main
Jean Chalard   authored and   Android (Google) Code Review   commited 2025-05-19 19:23:31 -07:00
0d0fc56209
Merge "Check whether CarrierConfigManager is null" into main
Jimi Chen   authored and   Android (Google) Code Review   commited 2025-05-19 18:48:10 -07:00
87e73ef81a
Check whether CarrierConfigManager is null
Currently, the CarrierConfigManager is null on several non-phone
projects, e.g. tv, wear devices. This is because CarrierConfigManager
is not supported on these devices.

This change checks whether it is null and improve error handling.

Flag: android.net.platform.flags.avoid_bad_wifi_from_carrier_config
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.MultinetworkPolicyTrackerTest \
      --update-device
Fix: 416654774
Change-Id: I40fa7139a349472b1d5cbd36b5bff286309aebc5

Jimi Chen   commited 2025-05-19 11:56:32 +00:00
b936f0c5fd
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 "Parcel Network#mPrivateDnsBypass" into main
Jean Chalard   authored and   Android (Google) Code Review   commited 2025-05-19 00:03:32 -07:00
499961d60f
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 "Add EthernetPortInfo class" into main
Chuwei He   authored and   Android (Google) Code Review   commited 2025-05-16 01:39:54 -07:00
59f8d2b8ed
Merge "Add a performance test for filteredClone." into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-15 22:42:27 -07:00
c1844e5f8e
Add EthernetPortInfo class
This patch adds EthernetPortInfo class which represents information of
an EthernetPort object.
This class is mainlt used in network callbacks.

Bug: 397536853
Test: atest ConnectivityCoverageTests
Flag: EXEMPT mainline

Change-Id: I8ab9fa934a710080163d951bb6619050ca38a2ee

Chuwei He   commited 2025-05-16 13:14:48 +09:00
76330fa8a2
Add a performance test for filteredClone.
atest ConnectivityCoverageTests:android.net.connectivity.android.net.NetworkStatsTest#testFilteredPerformance -- --auto-collect DEVICE_TRACE

Flag: TEST_ONLY
Change-Id: Id47edc05bb39ce334da819129d4ee13b0796cbb5

Richard Uhler   authored and   Lorenzo Colitti   commited 2025-05-15 21:06:04 -07:00
bcd9653ed3
Merge "Add a test to ensure link-local prefix does not trigger PD" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-15 20:24:41 -07:00
d46183bf8c
Add a test to ensure link-local prefix does not trigger PD
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I77993cf154d4a3351294574735a238bd9db2da71

Patrick Rohr   commited 2025-05-15 18:45:36 -07:00
82d5add0c2
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 "Enable REQUEST_RESTRICTED_WIFI and CARRIER_SERVICE_CHANGED_USE_CALLBACK by default with kill switch" into main
Ying Xu   authored and   Android (Google) Code Review   commited 2025-05-15 09:44:48 -07:00
d49e884b27
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
Don't warn in tests for deprecation
This change removes hundreds of lines of useless warnings, since
tests must check the continued working of old and deprecated methods.

Test: build manually and observe the warnings are gone
Flag: EXEMPT test-only
Change-Id: Ie50b2f35b09041e8e201b30b1e575e66e045bc44

Chalard Jean   commited 2025-05-15 09:04:02 +09:00
87df372535
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
Enable REQUEST_RESTRICTED_WIFI and CARRIER_SERVICE_CHANGED_USE_CALLBACK by default with kill switch
Bug: 416044405

Test: atest ConnectivityManagerTest
      atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.ConnectivityServiceTest
Change-Id: I1b67c00ce3d4054414ce9c538ec4d7b9a55b4302
Flag: com.android.net.flags.request_restricted_wifi

Ying Xu   commited 2025-05-14 10:56:45 -07:00
7e4e0952f8
Merge "Disallow the legacy tether API for Wi-Fi." into main
Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-05-13 16:59:38 -07:00
61b1008d0f
Merge "Add unit test for filteredClone." into main
Richard Uhler   authored and   Android (Google) Code Review   commited 2025-05-13 13:02:06 -07:00
918c8e490f
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 "Fix IPv4 link-local, default routes network guess" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-12 21:17:59 -07:00
bff79be55a
Fix IPv4 link-local, default routes network guess
Inet4Address#isLinkLocalAddress can also return true if the address is
in the 169.254.0.0/16 range.

The code should also only consider directly-connected routes for
guessing, as default routes would match any address.

This is not used in platform code. This code path is only used when the
mDNS stack is used as a library.

Bug: 415483522
Test: atest
Flag: EXEMPT dead code in the platform
Change-Id: I53d8ad7f96368d4609b1baa804cd75aa65628c0c

Remi NGUYEN VAN   commited 2025-05-13 11:36:00 +09:00
5453629266
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
Merge "add an integration test to verify DHCPv6 PD rebind for P flag." into main
Xiao Ma   authored and   Android (Google) Code Review   commited 2025-05-12 08:03:06 -07:00
4ecd24ee94
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