Commit graph android_packages_modules_Co.../tests/cts
Message SHA1
Merge "Add Ping4 offload for APFv6 multi-devices tests" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-13 12:03:23 -07:00
fab8a76659
Merge "Add at_least_B() decorator to restrict multi-device tests to Android B+ capable device." into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-13 12:01:33 -07:00
d5dd81741c
Revert "Reject TetheringRequests that fuzzy-match existing ones"
Revert submission 3527440

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

Reverted changes: /q/submissionid:3527440

Change-Id: Ife596c639899528778f53fef797749fa88596dd6

Priyanka Advani (xWF)   commited 2025-03-13 10:22:16 -07:00
01b6b070ad
Revert "Stop tethering request only if fuzzy-matched to existing..."
Revert submission 3527440

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

Reverted changes: /q/submissionid:3527440

Change-Id: I31ae861d5151c9db7e559ba19db7f07c9545d422

Priyanka Advani (xWF)   authored and   Gerrit Code Review   commited 2025-03-13 10:22:16 -07:00
e72faa10ed
Add Ping4 offload for APFv6 multi-devices tests
Introduce Ping4 offload support for improved APFv6 multi-device testing.
Adds a decorator to restrict tests to Android B+ capable client device.

Test: m connectivity_multi_devices_snippet && atest CtsConnectivityMultiDevicesTestCases
Change-Id: I01909c1725ba471726223deef325c3f0a80b5c14

Jimi Chen   commited 2025-03-13 14:05:26 +00:00
0f3f5517e1
Add at_least_B() decorator to restrict multi-device tests to Android B+ capable device.
Test: TH
Change-Id: Id5fde8c59560bb84bed062331121c3524f362c7b

Jimi Chen   commited 2025-03-13 14:05:09 +00:00
476552a7ae
Stop tethering request only if fuzzy-matched to existing request
stopTethering with a TetheringRequest should only stop tethering if
there is an existing request (pending or serving) that fuzzy-matches the
input and whose UID matches the caller (unless the caller is Settings,
which is allowed to remove any request).

If there is no existing fuzzy-matched request, return
TETHER_ERROR_UNKNOWN_REQUEST.

Bug: 216524590
Test: atest TetheringTest RequestTrackerTest TetheringManagerTest
Change-Id: Ia8a8eab78fbecd38321fd0d48734855cff16febb

Quang Anh Luong   commited 2025-03-13 12:49:08 +09:00
a73b21ac11
Reject TetheringRequests that fuzzy-match existing ones
Legacy behavior will return success results to multiple startTethering
calls of the same type, even though the link layer can only support one
of those requests at a time (other than tethered AP + LOHS).

For B+, clean up this behavior by only allowing the amount of requests
that the link layer can concurrently support. To do this, we'll
introduce the concept of "fuzzy-matching" such that if a new request
fuzzy-matches an existing request (either pending or serving), this
indicates that the link layer cannot support the new request
concurrently, and we'll fail the new request with
TETHER_ERROR_DUPLICATE_REQUEST.

To keep track of serving requests, we'll store the request and it's
IpServer in RequestTracker when we call IpServer.enable(), and we'll
remove it (indexed by IpServer) when
1) Calling IpServer.onStop()
2) Calling IpServer.unwanted()
3) We detect an IpServer transition to AvailableState with error code

Bug: 216524590
Test: atest TetheringTest RequestTrackerTest TetheringManagerTest
Change-Id: I1e193f3595a48f806fb70fd08630a12ce2631a59

Quang Anh Luong   commited 2025-03-13 11:11:17 +09:00
2add9260ef
Merge "Use SdkLevel.isAtLeastB() instead of SDK_INT" into main
Quang Luong   authored and   Gerrit Code Review   commited 2025-03-11 14:42:37 -07:00
b453055426
Revert "Return the registry in registerNetworkAgent."
This reverts commit 70ede3260c.

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

Change-Id: If72cc264c5e505348309c6c11dbbfd11adeaf31b

Chaitanya Cheemala (xWF)   authored and   Gerrit Code Review   commited 2025-03-11 06:05:49 -07:00
846fb39e8a
Use SdkLevel.isAtLeastB() instead of SDK_INT
Replace the explicit SDK_INT checks with the helper function
SdkLevel.isAtLeastB().

Bug: 216524590
Test: covered by existing tests
Change-Id: I32ae771d5b157d97dfbe3c37caf62e734eaa250e

Quang Anh Luong   commited 2025-03-11 17:16:56 +09:00
96f8e1b787
Return the registry in registerNetworkAgent.
Also make the network agent registry two way to eliminate
reordering possibilities.

Test: ConnectivityCoverageTest, CtsNetTests
Change-Id: I0fd90716b9f5501bdcdc7ee5165321737a0076ae

Chalard Jean   commited 2025-03-11 16:26:17 +09:00
70ede3260c
Merge "Ensure APF counter increased for testDropPingReply() and testReplyPing()" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-10 16:23:06 -07:00
e85288d628
Merge "Specify the expected VPN network callbacks." into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-10 02:29:53 -07:00
cd4258dcb1
Specify the expected VPN network callbacks.
The test expects validated VPN network callbacks. However, an
unexpected Wi-Fi link bandwidth change during the test introduces
flakiness. To enhance test stability, specify the expected
callbacks to reduce flakiness.

Bug: 401489016
Test: atest CtsHostsideNetworkTests --iteration
Change-Id: I152ba5a4ff6c4a124db820f0eb58bb057e4dee5b

Paul Hu   commited 2025-03-10 08:09:00 +00:00
8217a0e760
Ensure APF counter increased for testDropPingReply() and testReplyPing()
Bug: 369354847
Test: atest ApfIntegrationTest
Change-Id: I2c28bfef75ae657663d43a21e051c002368c3448

Jimi Chen   commited 2025-03-07 13:16:30 +00:00
70b4577a64
Merge "Avoid fd to be closed by ParcelFileDescriptor's finalizer" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2025-03-04 18:58:57 -08:00
ff9b941bcc
Merge "Add coverage for StopTetheringCallback default methods" into main
Quang Luong   authored and   Gerrit Code Review   commited 2025-03-04 03:29:28 -08:00
a812717d2d
Add coverage for StopTetheringCallback default methods
StopTetheringCallback implements no-op default methods, so call these explicitly in the CTS test to satisfy the coverage linter.

Bug: 385014495
Bug: 385278741
Test: build
Change-Id: Ife938fc5acb6635f201cfb0dadccb601e513c929

Quang Anh Luong   authored and   Quang Luong   commited 2025-03-04 01:08:57 -08:00
7e4a1aa758
Fix incorrect comment about SDK version.
Unreleased SDK version is 10000, not 100000.

The code is already correct, only the comment is wrong.

Test: comment-only change
Change-Id: Ib006e98cbaf10b7da0f7a80df8d6a99527923743

Lorenzo Colitti   commited 2025-03-03 20:30:24 -08:00
74b941f327
Merge "Cleanup python version properties" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-03 16:12:48 -08:00
603c07f699
Avoid fd to be closed by ParcelFileDescriptor's finalizer
testBlockIncomingPacketsis flaky since ParcelFileDescriptor's
finalizer closes fd and makes fd invalid.
This CL fixes this issue by keeping the reference to
ParcelFileDescriptor.

Bug: 394503660
Test: testBlockIncomingPackets
Change-Id: I1c1645d95b9d9ae1bd5af4ada500f50f350b6b0b

Motomu Utsumi   commited 2025-03-03 15:21:11 +09:00
7a2c62c6a0
Mark the pendingIntent_classNotFound test as needing updated code
The tests for Connectivity will run on older versions of the module
unless you put this annotation on the test. In this case this will
happily crash some devices.

Bug: 399659876
Test: TH
Change-Id: I149883c9e461878a228687a96f04f0b4ebf2408a

Chalard Jean   commited 2025-03-03 11:04:15 +09:00
7b377e1691
Cleanup python version properties
Now that python 2 is fully removed, there's no need for
version-specific properties. Remove them.

Also remove usages of embedded_launcher: true, as that
is the new default value.

Bug: 399954452
Test: Presubmits
Change-Id: I368416638bbf1f5e76f7756792d537f72f3c9714

Cole Faust   commited 2025-02-28 16:34:06 -08:00
f5d1d3a705
Merge "ConnectivityMultiDevicesTest#test_mdns_via_wifip2p" into main
Yeabkal Wubshit   authored and   Gerrit Code Review   commited 2025-02-27 14:01:41 -08:00
bf166ad534
Address review comments from aosp/3482151
I didn't notice repo had failed the last upload with error 500...

This patch addresses the last outstanding comment.

Test: ConnectivityManagerTest
Change-Id: I970613a71e0b1854261e9615ff113a1d404fc1d0

Chalard Jean   commited 2025-02-27 15:54:50 +09:00
cd99e8c839
Merge "Fix : crash ConnectivityService when PendingIntent is canceled" into main
Jean Chalard   authored and   Gerrit Code Review   commited 2025-02-26 22:17:11 -08:00
5c909394a6
Fix : crash ConnectivityService when PendingIntent is canceled
PendingIntent.send will throw CanceledException when the intent
can't be sent, because it was canceled or some other reason. In
some, but not all of these cases, it will still call onSendFinished
after the send is done. This means there is no way to be sure
to do something exactly once after the intent is sent.

Unfortunately, ConnectivityService must keep a wakelock until
sent is finished, and wakelocks must be released exactly once.
Too bad.

The simplest solution is to create a specialized listener object
that can manage the lifecycle of the wakelock. This allows
very localized code, easy review and checking, cheap thread
safety, and not creating multiple locks. It also avoids the
ConnectivityService class implementing OnFinished itself,
which is arguably not very readable considering how big
the class is.

Test: new test that crashes the system without the patch
Fixes: 390043283
Change-Id: Ice528eddaedb4d663098eb2bb0ae7183dafbc073

Chalard Jean   commited 2025-02-27 11:46:06 +09:00
f34735ebdc
Merge changes If35a4b83,Ibe52ccd9 into main
* changes:
  Enable Bluetooth before running testReserveL2capNetwork
  Reverse pollingCheck arguments to be more kotlin friendly

Treehugger Robot   authored and   Gerrit Code Review   commited 2025-02-26 15:28:08 -08:00
3e93861b3d
Enable Bluetooth before running testReserveL2capNetwork
Bug: 397740298
Test: TH
Change-Id: If35a4b83ab8f96d0c98b3bf2ecb8b0e68420c4fe

Patrick Rohr   commited 2025-02-26 13:50:06 -08:00
d1cca845e2
Merge "Add edge case test for invalid program length in apf_run()." into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2025-02-25 19:38:00 -08:00
b458d99447
Reverse pollingCheck arguments to be more kotlin friendly
Test: TH
Change-Id: Ibe52ccd9eec619ced5f8b84896d2a1efc6c0fefc

Patrick Rohr   commited 2025-02-25 15:30:52 -08:00
7f9469e808
Move pollingCheck to testutils
Test: TH
Change-Id: I7d9362dcda095f8037467baf3602911fc3a3c072

Patrick Rohr   commited 2025-02-25 15:30:51 -08:00
b4809fdd08
Merge changes Ia273344f,Iab107c58,I5d5bcafb,I0d96bfa3 into main
* changes:
  Delete unused createTapInterface method
  Delete unused createTapInterface method
  Replace createTapInterface() with new Builder API
  Replace createTapInterface() call with new Builder API

Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-02-24 15:26:06 -08:00
3e9ac4ba7f
Replace createTapInterface() with new Builder API
Test: TH
Change-Id: I5d5bcafb2b91dd31b7d2aa71f62279ab79d971bf

Patrick Rohr   commited 2025-02-24 09:19:44 -08:00
2bef486f76
Replace createTapInterface() call with new Builder API
Test: TH
Change-Id: I0d96bfa39a378a8dcc03c2366c332ae5eb8e69d6

Patrick Rohr   commited 2025-02-24 09:19:44 -08:00
f8471445dc
Remove obsolete APF_NEW_RA_FILTER_VERSION flag.
This commit removes the obsolete APF_NEW_RA_FILTER_VERSION flag from
ApfIntegrationTest. The LegacyApfFilter has been deprecated, rendering
this flag unnecessary.

Test: TH
Change-Id: Ia7da139a0f0af5f6e59012fb6dac35590133c1a6

Yuyang Huang   commited 2025-02-24 17:38:41 +09:00
61b68f81e9
Merge changes I77101952,I399631c6,I5ea98a06,I0b243f45,I5554cd42, ... into main
* changes:
  Fix test comment
  Enable header compression when requested
  Implement 6lowpan header compression
  Add a basic CSTest for L2capNetworkProvider
  Release network reservations in tearDown
  Start L2capNetworkProvider in CS
  Revert "Join HandlerThread if BLE is not supported"

Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-02-18 21:39:41 -08:00
90a2f97e4c
ApfIntegrationTest: adjust for addLoad{8,16}(R0, x) -> addLoad{8,16}intoR0(x)
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I3cf1052dac1951fe6155641b1a7aef6014ba1a0d

Maciej Żenczykowski   commited 2025-02-18 19:39:52 -08:00
349f14790d
Release network reservations in tearDown
Test: TH
Change-Id: I5554cd424efb692fabdae1420f257a70ee94de19

Patrick Rohr   commited 2025-02-18 19:22:32 -08:00
4a966de7f3
Start L2capNetworkProvider in CS
Starts L2capNetworkProvider in ConnectivityService. Alternatively, this
could be moved to ConnectivityServiceInitializer instead in a follow up.

When L2capNetworkProvider is created, it starts a handler thread, so
makeL2capNetworkProvider must return null in tests as otherwise the
thread leaks.

Test: atest NetworkReservationTest
Change-Id: I35c14815b1a71f0739c1bf63ad466763d611434c

Patrick Rohr   commited 2025-02-18 19:19:22 -08:00
611ce3f57c
Do not expect validated when connect to Wi-Fi for upstream type None
Currently, upstream network validation is always required, even
for type None. This is unnecessary for APF and mDNS tests, as
they can be executed on local networks. Additionally, some
devices lack the ability to perform network validation when the
hotspot is enabled due to hardware limitations. Therefore, remove
the validation check for upstream type None.

Test: m connectivity_multi_devices_snippet && \
      atest CtsConnectivityMultiDevicesTestCases:ConnectivityMultiDevicesTest
Bug: 335368434
Bug: 396551848
Change-Id: If2a96cf9d62e37fc27be6193f9ce9b9cfc8613df

Junyu Lai   authored and   Paul Hu   commited 2025-02-17 21:22:19 -08:00
d16aa5538e
Remove unnecessary TODO comment.
Test: N/A
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2f7c527121fa1cc965d2a0cc864c0665033f1d0e

Maciej Żenczykowski   commited 2025-02-17 13:07:44 -08:00
eedc615893
Ipsec: enable tests on 25Q2+
This change is in theory a no-op:
- all 25Q2+ kernels should be 64-bit
- all 5.10+ kernels should be 5.10.210+ or 5.15.149+.
  (this only leaves 5.4.x kernels)

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0bedff990239c6cbf42a594aa0bb50f1ca89b3e8

Maciej Żenczykowski   commited 2025-02-17 10:31:26 -08:00
49429f348c
Add edge case test for invalid program length in apf_run().
This commit updates the testPrefilledMemorySlotsV4() test to include an
edge case where an invalid program length is passed to apf_run() due to
a firmware program update.

Bug: 395545572
Test: TH
Change-Id: I678615139ab6b115cd851ffa8336459988c50ef6

Yuyang Huang   commited 2025-02-14 09:55:10 +09:00
9ed841724c
Merge "Fix: Resolve a ktlint error in ApfIntegrationTest" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-02-13 10:06:54 -08:00
5e8299f67e
ConnectivityMultiDevicesTest#test_mdns_via_wifip2p
This test fails because Wear devices dont
support WIFI direct

Bug: 369252118

Test: atest CtsConnectivityMultiDevicesTestCases:ConnectivityMultiDevicesTest#test_mdns_via_wifip2p -- --abi arm64-v7a
Change-Id: I6f033d8d5eed1b4de0a5924d1e61b611f18d3a8a

Ankit Verma   authored and   Ankit Verma (xWF)   commited 2025-02-13 01:04:33 -08:00
5617e125cf
Fix: Resolve a ktlint error in ApfIntegrationTest
Test: TH
Change-Id: Ice4f78f27ff36e919ddf980dac9a5b4abbcc04b1

Yuyang Huang   commited 2025-02-13 11:28:11 +09:00
ec80a42735
Add CTS coverage for TetheringInterface with SoftApConfiguration
Cover TetheringInterface constructor with SoftApConfiguration and
TetheringInterface#getSoftApConfiguration.

Bug: 394510260
Test: atest TetheringManagerTest
Change-Id: I61d111bdea72b911b85e129ded93cfc02ce6ef2f

Quang Anh Luong   authored and   Quang Luong   commited 2025-02-09 22:23:53 -08:00
9c698d26ec
Merge "Add CTS test for ConnectivityManager#tether exception after V" into main
Quang Luong   authored and   Gerrit Code Review   commited 2025-02-09 22:04:43 -08:00
0e480b7857