Commit graph android_packages_modules_Co.../tests/cts
Message SHA1
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
Completely disable flaky APF multidevice CTS class
Due to ongoing issues discovered in the APF multidevice CTS, it is safer
to disable the entire test suites rather than individual test cases.
This change removes the ApfV4Test and ApfV6Test classes.

Bug: 406570694
Test: TH
Flag: EXEMPT bugfix
Change-Id: I0f176e2a075fb33625fcc824418484df10137ccc

Yuyang Huang   commited 2025-04-24 16:38:10 +09:00
5d3dc48289
Merge "Remove non-functional IGMPv3 test and flaky APF checks" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-04-22 03:38:25 -07:00
90ba9c5ee9
Remove non-functional IGMPv3 test and flaky APF checks
This commit removes the test_igmpv3_general_query_offload() test
logic. This test fails on user builds because they run on non-rootable
devices, preventing the necessary test operations.

Additionally, the APF counter check logic is removed as it was causing
test flakiness and instability.

Bug: 406570694
Test: TH
Flag: EXEMPT test only change
Change-Id: I9f2f32c49737721e537d578d6df41d4062d0684f

Yuyang Huang   commited 2025-04-22 18:02:55 +09:00
3781d05054
Merge "Move getTestableNetworks to a common location" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-04-21 00:36:58 -07:00
cb677726c6
Move getTestableNetworks to a common location
Use a common code path for getTestableNetworks, which obtains Wi-Fi and
cellular from network callbacks. This avoids mixing callbacks and
synchronous calls, as getTestableNetworks may be called after
ensureWifiConnected, which uses NetworkCallbacks.

Test: atest
Bug: 253698734
Flag: TEST_ONLY
Change-Id: I8bf946b5258270554286e52b8aa3189aa2ba52e1

Remi NGUYEN VAN   commited 2025-04-21 15:18:57 +09:00
46f86934e1
Merge "Clean up the CtsNetTestCasesMaxTargetSdk filters" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-04-18 01:09:38 -07:00
298954da0d
Merge "Add logs for awaitPrivateDnsSetting" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-04-17 13:30:22 -07:00
6ffc2751e7
Add logs for awaitPrivateDnsSetting
To help investigate flakes when calling awaitPrivateDnsSetting, add more
logs.

Bug: 253698734
Test: atest
Flag: TEST_ONLY
Change-Id: I224b2693b61003a723d1e67e970232c00bd94f84

Remi NGUYEN VAN   commited 2025-04-17 18:15:35 +09:00
2d9d1d129c
Merge "Test Tethering/NetworkStack package existence for SYSTEM and FULL users." into main
Junyu Lai   authored and   Android (Google) Code Review   commited 2025-04-16 17:59:55 -07:00
7eb06e32ab
Test Tethering/NetworkStack package existence for SYSTEM and FULL users.
Follow-up from aosp/3405539, it is possible that OEMs do not
install Tethering/NetworkStack for certain user types.
This is undesirable. Therefore, enforce this with CTS test cases.

Flag: TEST_ONLY
Test: m CtsTetheringTest && atest \
      CtsTetheringTest:android.tethering.test.TetheringManagerTest
Fix: 400836850

Change-Id: I176d4930040d288846bde43beda9e30519ecd513

Junyu Lai   commited 2025-04-16 06:57:18 -07:00
90c80840d8
Merge "Update TetheringWifiP2pTest to check for tethering support" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-04-14 21:09:35 -07:00
0e8e9f2079
Merge "Wait for Wi-Fi validation after reconnect" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-04-14 03:57:14 -07:00
056966f164
Update TetheringWifiP2pTest to check for tethering support
This check is needed for devices which doesn't support tethering,
e.g. wear devices

Flag: TEST_ONLY
Test: lunch cf_gwear_x86-next-userdebug
      atest CtsTetheringTest:android.tethering.cts.TetheringWifiP2pTest#testWifiP2pGoNetworkAgent_networkCallbacks \
      -- --test-arg com.android.testutils.ConnectivityTestTargetPreparer:ignore-mobile-data-check:true
Fix: 408634222
Change-Id: I1b17eec973615f4d934e831de521d7699da7b3fd

Junyu Lai   commited 2025-04-14 18:22:42 +08:00
4eabd39084
Wait for Wi-Fi validation after reconnect
RestoreDefaultNetwork has been flaky due to delays in Wi-Fi validation
after reconnecting (sometimes exceeding 30 seconds).
RestoreDefaultNetwork fails at the end of all tests. So connectivity
diagnostics does not contain diagnostics for the network that fails to
be validated.
This CL updates some tests to fail if the Wi-Fi network is not
validated within 30 seconds after the reconnect. This ensures that
connectivity diagnostics include the diagnostics for the problematic
network.

Flag: TEST_ONLY
Bug: 361401328
Test: ConnectivityManagerTest
(cherry picked from https://android-review.googlesource.com/q/commit:cd1bd59a1a18b04e71c3137c4e7d506757691c6c)
Merged-In: Ifeadc8b030f0073133df4fca838e64f1b37e735c

Change-Id: Ifeadc8b030f0073133df4fca838e64f1b37e735c

Motomu Utsumi   commited 2025-04-14 00:08:52 -07:00
72b851928c
Clean up the CtsNetTestCasesMaxTargetSdk filters
Instead of relying on the test runner ignoring "include-annotation" if
the annotation class is not part of the APK, and on the module name
matching the annotation name, specify the annotation in the build rule.

This makes the test setup easier to understand and less likely to break
with test runner behavior changes or annotation/test renames.

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

Remi NGUYEN VAN   commited 2025-04-14 13:02:16 +09:00
61b73b444a
Merge "Print module version in CtsNetTestCases conndiag" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-04-10 02:09:09 -07:00
e2209bf89b
Print module version in CtsNetTestCases conndiag
Bundle the version of the tethering APEX in the build branch into
CtsNetTestCases as a resource, and include it in the failure header on
test failure.

This should make it easy to identify what version of the module matches
the built test when investigating test failures.

Test: atest
Flag: TEST_ONLY
Change-Id: I15a53b3d7649ebde9706b10ee504d08aa78ee7de

Remi NGUYEN VAN   commited 2025-04-10 16:41:29 +09:00
6ee6075685
Merge "Only set the carrier service package on supported devices" into main
Jean Chalard   authored and   Android (Google) Code Review   commited 2025-04-09 15:57:02 -07:00
86fb573931
Only set the carrier service package on supported devices
Not all U devices support this. It's only supported by U QPR1+.

Bug: 404415649
Test: NetworkAgentTest
Flag: EXEMPT bugfix
Change-Id: I66d30b5f0be5628561bfeb1f90f5318954544e31

Chalard Jean   authored and   Jean Chalard   commited 2025-04-08 00:51:44 -07:00
d3db165d9e
Prevent ApfIntegrationTest from calling LowPowerStandby APIs from pre U
This commit ensures that ApfIntegrationTest does not call low power
standby APIs on Android versions prior to U, as those APIs are only
available on Android U and later.

Bug: 409115206
Flag: EXEMPT bug fix
Test: manual verify on S cuttlefish
Change-Id: Id4d17e9708b0a75cf6b4f68907465af37bad264b

Yuyang Huang   commited 2025-04-08 13:01:45 +09:00
f958d71ceb
Merge "Increase timeout for ApfIntegrationTest#testReadWriteProgram()" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-04-07 14:27:02 -07:00
ccc56e4141
Use scope_guard and unique_fd in MultinetworkApiTest_runDatagramCheck
Test: TH
Flag: no
Bug: 1000001
Change-Id: Icaf5cc553ceedc0ed5a0a0e1241c8cf6acf25a91

Patrick Rohr   commited 2025-04-07 11:01:07 -07:00
4e8098fcb0
Prevent use-after-free
This test could really benefit from using scope guards instead.

Test: TH
Bug: 406263334
Flag: no
Change-Id: I508c9843a8980767b4c25f86a6ca399276cb14c8

Patrick Rohr   commited 2025-04-07 09:34:36 -07:00
00abef4936
Increase timeout for ApfIntegrationTest#testReadWriteProgram()
This commit increases the timeout for the
ApfIntegrationTest#testReadWriteProgram() test case from 15 minutes to
20 minutes. This change ensures that the test does not timeout on slower
devices.

Bug: 407721406
Flag: EXEMPT bug fix
Test: TH
Change-Id: I8c2b5d36aebc2f2fa66f2d72cccd88bf74f50b68

Yuyang Huang   commited 2025-04-07 18:42:43 +09:00
4de8b4443a
Merge "Temporarily disable low power standby during ApfIntegrationTest" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-04-06 16:25:18 -07:00
7ecabd1bea
Temporarily disable low power standby during ApfIntegrationTest
ApfIntegrationTest includes test cases that require turning off the
screen and waiting before sending packets. On devices with low power
standby capabilities, such as Android TVs, the packets sent by these CTS
test cases can be blocked. To prevent this interference, this commit
temporarily disables the low power standby policy during test execution.

Bug: 407698167
Flag: EXEMPT bug fix
Test: manually test on TV and Phone
Change-Id: I7312626b4d1939847e5bf5267da5e81dab241a64

Yuyang Huang   commited 2025-04-06 12:10:59 +09:00
6b24c93fe4
Merge changes Ia1e08c43,Ifbca38e6 into main
* changes:
  Delete RouterAdvertisementResponder
  Rewrite RouterAdvertisementResponder in Kotlin

Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-04-04 11:02:03 -07:00
8ca69b3028
Delete RouterAdvertisementResponder
And move all other tests over to NdResponder.

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: Ia1e08c439a039a4ffa020318da44652fadadf5c9

Patrick Rohr   commited 2025-04-03 22:09:47 -07:00
d107a1692f
Rewrite RouterAdvertisementResponder in Kotlin
And integrate into EthernetManager. So it can make proper use of
PacketBuilderUtils.

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: Ifbca38e6efde68e015c69bf919d079d1605310d1

Patrick Rohr   commited 2025-04-03 21:59:21 -07:00
75a83c51ad
Skip testMobileDataPreferredUids on automotive
Test: android.net.cts.ConnectivityManagerTest#testMobileDataPreferredUids
Bug: 404186833
Flag: TEST_ONLY
Change-Id: I71843f9cfd0692f1ad1e5d55b9559a1a3f5d3919

Tomasz Wasilczyk   commited 2025-04-02 18:39:22 -07:00
9236a3e6bf
Merge changes I32095316,I709082c0 into main
* changes:
  Add integration test for Wifi P2p Group Owner Network Agent
  Support Wifi P2P Group Owner local network agent

Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-04-02 18:09:33 -07:00
6f3cf21daa
Merge "Improve stability of APFv{4,6} multi-device tests" into main
Yuyang Huang   authored and   Android (Google) Code Review   commited 2025-04-02 06:42:36 -07:00
1843442d0a
Improve stability of APFv{4,6} multi-device tests
This commit enhances the stability of the APFv{4,6} multi-device tests by addressing several sources of flakiness and improving the test setup and validation.

Specifically, this commit:

* Increased sleep time in the test setup. This ensures APF is activated before each test, preventing unexpected behavior.
* Added sleep time in `ApfV4Test` to ensure APF remains enabled and is not disabled due to high throughput scenarios.
* Changed the validation order to first check received packets and then APF counters. This helps to more easily identify the root cause of test failures.
* Changed the Ethernet destination address from multicast to unicast in `ApfV6Test` to prevent packets from being filtered due to DTIM skip.
* Removed the `test_broadcast_arp_request_offload()` test, which was flaky due to DTIM skip and is adequately covered by the `test_unicast_arp_request_offload()` test.

Bug: 406570694
Flag: TEST_ONLY
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV4Test
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV6Test
Test: run cts -m CtsConnectivityMultiDevicesTestCases --skip-preconditions -t ApfV4Test --shard-count 2
Test: run cts -m CtsConnectivityMultiDevicesTestCases --skip-preconditions -t ApfV6Test --shard-count 2
Change-Id: I053509459078d0bd94e16a6bf7349b948f930e6c

Jimi Chen   authored and   Yuyang Huang   commited 2025-04-02 04:31:01 -07:00
744a17443a
Add integration test for Wifi P2p Group Owner Network Agent
This exercise tests the flow from WifiP2pManager APIs to the
network callbacks fired by the ConnectivityService, on a
single device.

This change also makes utilities under
com.google.snippet.connectivity into a java library so they
can be reused by other modules.

Flag: TEST_ONLY
Test: m CtsTetheringTest && atest \
      CtsTetheringTest:android.tethering.cts.TetheringWifiP2pTest
Bug: 406172997
Change-Id: I32095316a5deadee7acba94c318fee666cd1303d

Junyu Lai   commited 2025-04-02 16:12:55 +08:00
35d2c6a7f3
Add hostapd callstack to TetheringManagerTest dump
TetheringManagerTest may fail on T devices in rare cases due to hostapd
hanging. Log the hostapd callstack upon failure in #testStopAllTethering
so we can analyze it the next time the failure happens.

Flag: EXEMPT test-only change

Bug: 299687365
Test: atest TetheringManagerTest
Change-Id: I59ce9dc98be7eb3689dae4863078360534edc802

Quang Anh Luong   commited 2025-04-01 16:49:26 +09:00
97e205cf0c
Move EthernetTestInterface to testutils
To make it usable for integration tests not in CTS.

Test: TH
Change-Id: If243997f086c442d4f0ef8f3c77760fada769448

Patrick Rohr   commited 2025-03-28 10:06:13 -07:00
f23f6ae45b
Revert "Revert "Add hidden API to register/unregister QUIC conne..."
Revert submission 3561690-revert-3538339-SNUWWZJNJZ

Reason for revert: NewAPI error will be fixed by separate CL

Reverted changes: /q/submissionid:3561690-revert-3538339-SNUWWZJNJZ

Change-Id: Ia7367e9332f4d376bd0be4c03c095ee00de9177a

Motomu Utsumi   commited 2025-03-27 08:49:00 +09:00
e8e28f6236
Revert "Add hidden API to register/unregister QUIC connection cl..."
Revert submission 3538339

Reason for revert: Likely culprit for b/406432012 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Reverted changes: /q/submissionid:3538339

Change-Id: I61b02f2b1b667e9a41b677f8062e8e96aac09f6e

Chaitanya Cheemala (xWF)   commited 2025-03-26 03:07:07 -07:00
947b53b0d3
Add hidden API to register/unregister QUIC connection close payload
QUIC stack running on the app process will call this API and register
QUIC UDP socket and UDP payload that can close QUIC connection.

When the app loses network access (e.g. due to freezer or firewall
chain), ConnectivityService 1)destroys the registered UDP socket by
sending a SOCK_DESTROY netlink message and 2)sends the registered UDP
payload to the server. This prevents unnecessary modem wakeups caused
by packets from the server after the apps lose network access.

Additionally, to close QUIC connection for apps that crash or are
killed, ConnectivityService sends the registered UDP payload when it
receives a socket destroy diag message for the registered socket.

Bug: 311792075
Test: CSDestroySocketTest CtsNetTestCases
Change-Id: I6cd727bd8bb0fe1d17360edfa395f73d24da6920

Motomu Utsumi   commited 2025-03-26 16:48:28 +09:00
627b8c6d34
Merge "Add Checks for mDNS Unregistration and Discovery Stop Operations" into main
Paul Hu   authored and   Gerrit Code Review   commited 2025-03-25 01:42:24 -07:00
aba4c46b53
Merge "Add connectivity pre-check for ConnectivityManagerApi23Test" into main
Paul Hu   authored and   Gerrit Code Review   commited 2025-03-25 01:32:35 -07:00
2795a1afb0
Add Checks for mDNS Unregistration and Discovery Stop Operations
mDNS service unregistration and discovery stop should only occur
if the mDNS service has registered or started discovery.
Therefore, a check is added to ignore unregistration or stop
requests if registration or discovery has not been executed.

Test: atest CtsConnectivityMultiDevicesTestCases
Change-Id: If7becd5a89a45da977141e8f9767a8ed85d9ba1b

Paul Hu   commited 2025-03-24 06:37:40 +00:00
f250c51a21
Add connectivity pre-check for ConnectivityManagerApi23Test
Bug: 401110123
Test: atest ConnectivityManagerApi23Test
Change-Id: I466ae73ddb48cf13e5cf396fd5002322e3fd755a

Paul Hu   commited 2025-03-23 15:06:44 +00:00
69b176143f
Merge "Grant the NEARBY_WIFI_DEVICES permission to VpnHostside tests" into main
Sarup Dalwani   authored and   Gerrit Code Review   commited 2025-03-21 09:48:51 -07:00
92bf2d9e26
Merge "Add multicast address cleanup for test failures" into main
Jimi Chen   authored and   Gerrit Code Review   commited 2025-03-21 06:31:49 -07:00
d2c266cbe9
Merge "Use scapy to generate Ethernet packet in multi-device test" into main
Jimi Chen   authored and   Gerrit Code Review   commited 2025-03-21 06:31:30 -07:00
ed52d9aee3
Grant the NEARBY_WIFI_DEVICES permission to VpnHostside tests
Fix forward for b/405308292

Background: new / existing runtime permission is now used to guard
access to local networks. apps / tests now need to hold this permission
to do traffic with local devices.

Test: CtsHostsideNetworkTests, TH
Bug: 405308292
Change-Id: Ib4892cc817946c74094bfc5d9c54a95bb17ad30b

Chalard Jean   commited 2025-03-21 21:07:13 +09:00
042ebce713
Merge "Make sure tests know to handle both early creation true and false" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-21 05:02:06 -07:00
a0fa137d85
Merge changes I7fae1964,Ic7cc9e1d into main
* changes:
  Add carrier-privileged app bypass for start/stopTethering
  Fix CarrierConfigRule#setHoldCarrierPrivilege race

Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-21 03:47:22 -07:00
d5743b9795