Commit graph android_packages_modules_Co.../tests/cts
Message SHA1
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
Make sure tests know to handle both early creation true and false
This is necessary to pass tests whatever the values of the features are.

NetworkAgentTest was updated assuming the feature was true, so
this patch revives the old code for when it's false.

TestableNetworkAgent reads the feature directly from
ConnectivityManager when it's not mocked.

Test: CtsNetTestCases
Change-Id: Ia556fbb1d1b6a38a4995b021981e2693d778bfff

Chalard Jean   commited 2025-03-21 19:29:06 +09:00
0cc8d81cc7
Merge changes Ic9fee5bb,I30fa35ce,If52cc211,I87e9d710 into main
* changes:
  Reapply "Immediately create networks unless chickened out"
  Reapply "Always disconnect agents immediately."
  Reapply "Make iterating over mNetworkAgentInfos safer."
  Let DSCP policy test accept early network agent creation

Jean Chalard   authored and   Gerrit Code Review   commited 2025-03-21 02:31:53 -07:00
3575c37e47
Add carrier-privileged app bypass for start/stopTethering
Allow carrier-privileged apps to call startTethering and stopTethering
for wifi tethering with a non-null SoftApConfiguration.

Bug: 295979433
Test: atest TetheringTests CtsTetheringTests

Change-Id: I7fae1964c44902b1d500729794fc59e5bdd185e5

Quang Anh Luong   commited 2025-03-21 18:25:28 +09:00
72d9102ab7
Merge "Changing the targetSdkVersion for RESTRICT_LOCAL_NETWORK" into main
Sarup Dalwani   authored and   Gerrit Code Review   commited 2025-03-20 23:13:12 -07:00
d43a4fdbfd
Reapply "Immediately create networks unless chickened out"
Now that the faulty test is fixed,
This reverts commit 0141d82c2d.

Test: ConnectivityCoverageTests CtsNetTestCases FrameworksTelephonyTests
Change-Id: Ic9fee5bb7efb8ca4c05d7c9e600236186d094080

Chalard Jean   commited 2025-03-21 14:57:25 +09:00
324365a901
Reapply "Always disconnect agents immediately."
Now that the faulty test is fixed,
This reverts commit 19dcc447c4.

Test: ConnectivityCoverageTests CtsNetTestCases FrameworksTelephonyTests
Change-Id: I30fa35cef1729e6ecd4140c52fabfa2da1a9bb4b

Chalard Jean   commited 2025-03-21 14:57:25 +09:00
9fdc988dc8
Changing the targetSdkVersion for RESTRICT_LOCAL_NETWORK
The targetSdkVersion was set to enable after current_development version
so the test cases targetting current do not have change enabled. It was
observed that user builds did not allowed changing compat flag on
current values. Changing this to enabled after baklava.

Bug: 405183129
Test: atest ConnectivityCoverageTests
Change-Id: Ifeb7cde9f1a7d2b5a254f297207d625bf9d02731

Sarup Dalwani   commited 2025-03-21 04:32:25 +00:00
5f020a5ab8
Let DSCP policy test accept early network agent creation
Test: DscpPolicyTest with and without the early creation patches
Change-Id: I87e9d710e54e861a5f6c2767da7db67329e1bb59

Chalard Jean   commited 2025-03-21 12:19:47 +09:00
d0ac32bfee
Use scapy to generate Ethernet packet in multi-device test
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV4Test
Change-Id: I28d8a2f54878bda47d0073bea6ee4931c091dcf1

Jimi Chen   commited 2025-03-21 01:36:18 +00:00
237a2d5843
Add multicast address cleanup for test failures
This change ensures cleanup to release multicast addresses allocated during the test when a test failure occurs.
Without this cleanup, failed tests could potentially causing issues in subsequent test runs.

Test: atest CtsConnectivityMultiDevicesTestCases
Change-Id: Idf8349c8c075cec8007f5041b1ed8812a006f7f4

Jimi Chen   commited 2025-03-21 01:11:12 +00:00
8e3bf62c74
Use scapy to generate ARP packet in multi-device test
Test: m connectivity_multi_devices_snippet && atest CtsConnectivityMultiDevicesTestCases
Test: atest NetworkStaticLibHostPythonTests
Change-Id: I30adfe7ca2fef83ed4ef2ea3e5bc2291b9016530

Jimi Chen   commited 2025-03-20 12:25:57 +00:00
f0343a65d1
Add IPv6 neighbor solicitation offload for APFv6 multi-devices tests
Test: m connectivity_multi_devices_snippet && atest CtsConnectivityMultiDevicesTestCases
Change-Id: I97f6a60ddfa3dcaf4aee0ea1db83cc9636031a54

Jimi Chen   commited 2025-03-20 11:14:50 +00:00
8e8bbcabde
Skip Ping6 offload multi-device test on devices with APF ram less than 3000
Test: TH
Change-Id: If17df379d9bec49a5d1c60b73091a77d9f3bb46d

Jimi Chen   commited 2025-03-20 11:14:50 +00:00
c5a9e2e745
Add MLDv2 offload for APFv6 multi-devices tests
Test: m connectivity_multi_devices_snippet && atest CtsConnectivityMultiDevicesTestCases
Change-Id: If07deb3405b889382e938550c7b09f90030f9d31

Jimi Chen   commited 2025-03-20 11:14:46 +00:00
3cc069adea
Merge changes from topic "revert-3548747-TOVIIQGWFJ" into main
* changes:
  Revert "Make iterating over mNetworkAgentInfos safer."
  Revert "Always disconnect agents immediately."
  Revert "Immediately create networks unless chickened out"

ESWAR MAGATAPALLI (xWF)   authored and   Gerrit Code Review   commited 2025-03-20 00:52:25 -07:00
5a3a51eb7a
Revert "Always disconnect agents immediately."
Revert submission 3548747

Reason for revert: Droidmonitor created revert due to b/404956859. Will be verified through ABTD for standard investigation.

Reverted changes: /q/submissionid:3548747

Change-Id: I44affb742ca066406e93fc75056b4d3d1298eadb

Satish Yalla   commited 2025-03-19 20:18:37 -07:00
19dcc447c4
Revert "Immediately create networks unless chickened out"
Revert submission 3548747

Reason for revert: Droidmonitor created revert due to b/404956859. Will be verified through ABTD for standard investigation.

Reverted changes: /q/submissionid:3548747

Change-Id: Ic4226f2f1a20965f80b554967568a4450e460da2

Satish Yalla   authored and   Gerrit Code Review   commited 2025-03-19 20:18:37 -07:00
0141d82c2d
Merge changes I65763a52,Ib1d77da3,I5d8b3850 into main
* changes:
  Immediately create networks unless chickened out
  Always disconnect agents immediately.
  Make iterating over mNetworkAgentInfos safer.

Jean Chalard   authored and   Gerrit Code Review   commited 2025-03-19 15:09:28 -07:00
451f2dd39d
Merge "Don't crash the system server when a misconfigured agent adds a DSCP policy" into main
Maciej Å»enczykowski   authored and   Gerrit Code Review   commited 2025-03-19 11:04:57 -07:00
51ac9ff7c4
Don't crash the system server when a misconfigured agent adds a DSCP policy
Additionally, when calling isEthernet(null), throw NPE instead of
SIGSEGV.

Test: New test in this patch
Change-Id: Ie80b860d4befe65a1777d0ebeb18d1807c6375d0

Chalard Jean   authored and   Patrick Rohr   commited 2025-03-19 08:24:45 -07:00
fd3ab6b212
Immediately create networks unless chickened out
Test: ConnectivityCoverageTests CtsNetTestCases
Change-Id: I65763a528fb2cc04700ac8468eeca762b9eb01b5

Chalard Jean   commited 2025-03-19 21:03:23 +09:00
a13e335983
Always disconnect agents immediately.
This relands aosp/2623893 now that the underlying timing
issues have been fixed. It also addresses the two outstanding
comments that had not been fixed. It conditions it on the
"queue in system server" feature.

Currently, various codepaths in ConnectivityService disconnect
networks using NetworkAgentInfo#disconnect. This posts a message
to the NetworkAgent to disconnect and also posts a message to
ConnectivityService to call disconnectAndDestroyNetwork, which
performs all cleanup in ConnectivityService. These two messages
race and the order is non-deterministic.

Instead, always disconnect using disconnectAndDestroyNetwork,
and have disconnectAndDestroyNetwork post the message to the
agent to disconnect.

This fixes a bug where if wifi uses unregisterAfterReplacement
twice in quick succession, when the third agent connects it
doesn't work because the interface is still being used by the
second network.

Bug: 286649301
Test: covered by existing tests
Change-Id: Ib1d77da39232c02060a7a7c016ffd3a969e2356d

Lorenzo Colitti   authored and   Chalard Jean   commited 2025-03-19 21:03:23 +09:00
0e9f5e626b
Merge "Skip hostside tethering test if not SdkLevel.isAtLeastB()" into main
Quang Luong   authored and   Gerrit Code Review   commited 2025-03-19 04:24:46 -07:00
b0cad64f5f
Skip hostside tethering test if not SdkLevel.isAtLeastB()
HostsideTetheringTest#testSoftApConfigurationRedactedForOtherApps is
only applicable in B+, so skip it if not.

Bug: 403129363
Test: atest HostsideTetheringTests
Change-Id: I6b4be858befcabb1892ee4113ac2cf17b5d49ca5

Quang Anh Luong   commited 2025-03-19 19:26:24 +09:00
cd2b87e4c9
Merge changes Idf75e4e9,Idf0435f4 into main
* changes:
  Process enqueued messages from the NAI synchronously.
  Remove the queue on the NetworkAgent side

Jean Chalard   authored and   Gerrit Code Review   commited 2025-03-18 18:07:59 -07:00
5eb96faaf6
Merge "Add Ping6 offload for APFv6 multi-devices tests" into main
Maciej Å»enczykowski   authored and   Gerrit Code Review   commited 2025-03-18 16:28:38 -07:00
ef10edc183
Merge changes Id3eba714,I595ba207 into main
* changes:
  Add CtsTetheringUtils methods for wifi tethering without permission
  Skip stopTetheringRequest tests if tethering isn't supported

Quang Luong   authored and   Gerrit Code Review   commited 2025-03-18 04:12:57 -07:00
e149a49c7d
Merge "Update ApfIntegrationTest for APFv6/v6.1 requirements" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2025-03-18 03:29:33 -07:00
a03654ad70
Remove the queue on the NetworkAgent side
Now that the system server has a queue doing this job,
the queue on the network agent side can be removed.

Test: ConnectivityCoverageTests, CtsNetTestCases
Change-Id: Idf0435f447cfdd28d829a867d1085771837c6f9b

Chalard Jean   commited 2025-03-18 19:23:57 +09:00
391ec5d99c
Merge changes I71abf9d0,I57f25f5e,If6b15419 into main
* changes:
  Reapply "Add a queue system server-side for NetworkAgent"
  Reapply "Unify registration and NM assignment in NAI"
  Reapply "Return the registry in registerNetworkAgent."

Jean Chalard   authored and   Gerrit Code Review   commited 2025-03-18 03:19:07 -07:00
6f2b294fd0
Update ApfIntegrationTest for APFv6/v6.1 requirements
This commit updates ApfIntegrationTest to reflect the latest
requirements for supporting APFv6 and APFv6.1, including their
respective memory requirements.

Test: TH
Change-Id: I29e8e692eaf8e378fea99bda36c752d9d729ed86

Yuyang Huang   commited 2025-03-18 18:10:06 +09:00
4797563fd3
Add Ping6 offload for APFv6 multi-devices tests
Test: m connectivity_multi_devices_snippet && atest CtsConnectivityMultiDevicesTestCases
Change-Id: I11b7cef13562884235bd4e505adec1fff381e7ab

Jimi Chen   authored and   Maciej Å»enczykowski   commited 2025-03-18 01:49:50 -07:00
c992100a71
Merge "Add IGMPv3 offload for APFv6 multi-devices tests" into main
Maciej Å»enczykowski   authored and   Gerrit Code Review   commited 2025-03-18 01:46:48 -07:00
e634a7da38
Merge changes from topic "vpn-type-oem-enterprise" into main
* changes:
  Treat new OEM VPN types like the corresponding non-OEM types.
  Add more NativeVpnType AIDL constants for OEM-specific VPNs.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2025-03-18 00:50:13 -07:00
944a1d2855
Add CtsTetheringUtils methods for wifi tethering without permission
Device Owner and Carrier-privileged tethering usage relies on starting
tethering without TETHER_PRIVILEGE permission. Add utilities to
CtsTetheringUtils to do this.

Bug: 295979433
Test: atest DeviceOwnerTest TetheringManagerTest
Change-Id: Id3eba71481e27ccfa32f2b0588b8a74c490c5311

Quang Anh Luong   commited 2025-03-18 16:24:39 +09:00
73b09281c0
Skip stopTetheringRequest tests if tethering isn't supported
Bug: 402315643
Test: atest TetheringManagerTest

Change-Id: I595ba20718cd13b7c6b6d66bf540c599ef48304e

Quang Anh Luong   commited 2025-03-18 16:24:31 +09:00
a4d16050f9
Add IGMPv3 offload for APFv6 multi-devices tests
Test: m connectivity_multi_devices_snippet && atest CtsConnectivityMultiDevicesTestCases
Change-Id: Ica704150527bca11b975b6f122678e69eaa04c71

Jimi Chen   commited 2025-03-18 06:21:22 +00:00
8d552bf2c0
Reapply "Return the registry in registerNetworkAgent."
Now that faulty Telephony tests have been disabled temporarily
to allow for this bugfix, this can be reverted.
This reverts commit 653d5f1ef4.

Test: FrameworksTelephonyTests CtsNetTestCases
Change-Id: If6b1541981803dc84de57b48adb13d40c9997fa0

Chalard Jean   commited 2025-03-18 14:42:39 +09:00
8a97692638
Treat new OEM VPN types like the corresponding non-OEM types.
Bug: 389829981
Test: new CTS tests
Change-Id: I9455a1e00db6fdca3706e83e26daa60db6c73d09

Lorenzo Colitti   commited 2025-03-18 14:34:18 +09:00
fd89cf529a
Add carrier privilege utils to CarrierConfigRule
Move the existing helper methods to acquire carrier privileges in
NetworkAgentTest.kt to CarrierConfigRule where it can be reused by other
CTS tests. Also reset the carrier service package override in the rule
cleanup.

Bug: 216524590
Test: atest NetworkAgentTest
Change-Id: Id907a2d641aa61838119e2be65654b9796464498

Quang Anh Luong   commited 2025-03-18 13:05:01 +09:00
a620310e9c
Merge changes from topic "revert-3535182-EBVRAQTHFS" into main
* changes:
  Revert "Return the registry in registerNetworkAgent."
  Revert "Unify registration and NM assignment in NAI"
  Revert "Add a queue system server-side for NetworkAgent"

Pechetty Sravani (xWF)   authored and   Gerrit Code Review   commited 2025-03-17 02:23:26 -07:00
67cc745550
Revert "Return the registry in registerNetworkAgent."
Revert submission 3535182

Reason for revert: <Droidmonitor created revert due to b/404070202.Will be verified through ABTD for standard investigation.>

Reverted changes: /q/submissionid:3535182

Change-Id: I2febd2ee7227d487d9cd69dcabd9c04f888fd2de

Pechetty Sravani (xWF)   commited 2025-03-17 00:48:05 -07:00
653d5f1ef4
Replace isTetheringWithSoftApConfig flag with B SDK check
isTetheringWithSoftApConfig flag is finalized, replace it with a simple
SdkLevel.isAtLeastB() check. This also fixes any issues with reading the
flag during boot.

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

Quang Anh Luong   commited 2025-03-17 15:18:29 +09:00
a10437f133
[Revert^2] 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.

Note: This was originally merged as aosp/3527440 but was reverted due to
a dependency CL being reverted. Remerging this on top of the fix for the
dependency CL.

Reverted changes: /q/submissionid:3541662-revert-3527440-JRJJTQBUFC

Bug: 216524590
Test: atest TetheringTest RequestTrackerTest TetheringManagerTest

Change-Id: I99dd2433efbb82f3721aa708ab50d198f6fbcb10

Quang Luong   authored and   Quang Anh Luong   commited 2025-03-17 15:18:29 +09:00
d093ea69b0
[Revert^2] 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

Note: This was originally merged as aosp/3529632 but was reverted due to
a crash when reading aconfig flags at boot. That issue has been fixed
here.

Reverted changes: /q/submissionid:3541662-revert-3527440-JRJJTQBUFC

Bug: 216524590
Test: atest TetheringTest RequestTrackerTest TetheringManagerTest

Change-Id: I87a1ed31927cda27d3b7fdd7c823b8f828f8d777

Quang Luong   authored and   Quang Anh Luong   commited 2025-03-17 15:18:29 +09:00
8b29d287f5
Merge changes I4bc29b10,I94a56b2b,I9ca025b1 into main
* changes:
  Add a queue system server-side for NetworkAgent
  Unify registration and NM assignment in NAI
  Return the registry in registerNetworkAgent.

Jean Chalard   authored and   Gerrit Code Review   commited 2025-03-16 15:57:51 -07:00
f04de0efc1
Merge "Add a method to help mocking registerNetworkAgent" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-14 01:25:28 -07:00
13a5d4b36e
Return the registry in registerNetworkAgent.
This is a resubmit of
I0fd90716b9f5501bdcdc7ee5165321737a0076ae
which did not account for testing of this private method
in Telephony tests.

Also make the network agent registry two way to eliminate
reordering possibilities.

Test: ConnectivityCoverageTest, CtsNetTests
Change-Id: I9ca025b1369dcb1202f906d5cff79e3d935b40da

Chalard Jean   commited 2025-03-14 13:23:50 +09:00
80d4326d76
Add a method to help mocking registerNetworkAgent
This is a trick to help mocking registerNetworkAgent without
having to import its return type. In the near future the
return type will be changed to a non-public class, which
can't be seen in CTS.

Really this shouldn't be necessary because only Connectivity
tests should mock ConnectivityManager, but the practice is
different and other mockers need this support.

See also aosp/3538922

Test: NetworkAgentTest
Change-Id: I3ac63d95d3830a3b413f9ad12b84ac426b63dd08

Chalard Jean   commited 2025-03-14 13:23:37 +09:00
8fd6347d35