Commit graph android_packages_modules_Co.../tests
Message SHA1
Merge "Add test for ingress to VPN address filtering" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-08-03 19:36:25 -07:00
a26cea6c1e
Merge "Add logging for onPermissionsChanged latency." into main
Hao Liu   authored and   Android (Google) Code Review   commited 2025-07-31 06:47:43 -07:00
85415edca0
Add logging for onPermissionsChanged latency.
Flag: com.android.tethering.mainline.beta.lnp_developer_opt_in
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.PermissionMonitorTest
Bug: 424558169

Change-Id: Ifb621149130212a2903a7c31eebd4126e7d9924a

Hao Liu   commited 2025-07-31 03:02:08 +00:00
55614983a6
Fix UnfinishedStubbingException when running testAutomotiveEthernetAllowedUids
Mocking the PackageManager while ConnectivityService is running
could throw an UnfinishedStubbingException. This change splits
the test into two distinct tests that don't need to change the
mocking value for PackageManager during testing.

Fix: 433600031
Test: atest ConnectivityServiceTest
Flag: TEST_ONLY
Change-Id: Ibcff2082d1e50e89c272573b4c719a7325c959fd

Paul Hu   commited 2025-07-30 08:36:26 +00:00
e4e65d7b48
Add test for ingress to VPN address filtering
aosp/3201971 and aosp/3208090 updated ConnectivityService not to add
filtering rule for TYPE_VPN_LEGACY and TYPE_VPN_OEM to fix the issue in
b/352424251
This CL adds tests to veirfy the fix.

Test: NetworkAgentTest
Bug: 364982471
Flag: EXEMPT test only change
Change-Id: Ic3c108b9018f2137c1ae870a88c06e03518874c6

Motomu Utsumi   commited 2025-07-30 16:29:42 +09:00
1cda4503f2
Merge "Add proto to store network configuration" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-07-25 16:48:31 -07:00
3e3e18b2f1
Merge "Notify offload engine with discovery service information" into main
Paul Hu   authored and   Android (Google) Code Review   commited 2025-07-25 01:48:41 -07:00
f98e4c2f7b
Merge "Do not restart after updateConfiguration in NCM mode" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-07-24 16:43:21 -07:00
8cef9e556e
Merge "Create CommonConnectivityJni to share between modules" into main
Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-07-24 09:56:39 -07:00
0e5defc1e9
Notify offload engine with discovery service information
Updated the NsdService to send all OffloadServiceInfo from the
MdnsDiscoveryManager to the OffloadEngine upon the OffloadEngine
is registered.

Bug: 410734687
Test: atest ConnectivityCoverageTests
Flag: EXEMPT legacy flag nsd_force_disable_mdns_offload
Change-Id: I833d244dd59e98818985c69edd2012a2aa4dc8e6

Paul Hu   commited 2025-07-24 07:43:32 +00:00
2fa3227110
Add proto to store network configuration
This patch adds proto which will be used to store network
configuration. This will be used in IpConfigStore.

Test: atest ConnectivityCoverageTests
Bug: 397536853
Flag: EXEMPT mainline

Change-Id: I83032ebc78c60cbf2fc8f9119471fc13ae7f09e1

Chuwei He   commited 2025-07-24 16:41:00 +09:00
5adb3c56aa
Merge changes I44b4c22c,I5777b2a7 into main
* changes:
  Add EthernetManagerTests for NCM-only interfaces
  Add missing assumeNoInterfaceForTetheringAvailable

Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-07-23 16:47:40 -07:00
be5bf33802
Do not restart after updateConfiguration in NCM mode
updateConfiguration() does not affect the interface / network in NCM
mode.

Test: TH
Flag: EXEMPT mainline
Change-Id: Ie865a1393e55cead622719dd768c456b8337b853

Patrick Rohr   commited 2025-07-23 14:35:22 -07:00
3a6d16e5b1
Merge changes I12e4d492,I4c787e9c,I52a36ebb into main
* changes:
  Add support for TestInterfaceMode to EthernetTracker
  Move call to setEthernetEnabled inside setIncludeTestInterfaces
  Add support for TestInterfaceMode in setIncludeTestInterfaces

Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-07-23 14:16:42 -07:00
23ce59740a
Add EthernetManagerTests for NCM-only interfaces
Test: TH
Flag: EXEMPT mainline
Change-Id: I44b4c22cedc8a11cd5ac9d8949360b6d630678af

Patrick Rohr   commited 2025-07-23 12:39:35 -07:00
15d17c134a
Add missing assumeNoInterfaceForTetheringAvailable
Otherwise, if an ethernet network is connected via NCM during the test,
the request for a local-only NCM network will bring down global
connectivity and might break the test.

Test: TH
Flag: EXEMPT mainline
Change-Id: I5777b2a7658566348de7a346e0b394f10fdb0dd4

Patrick Rohr   commited 2025-07-23 11:57:54 -07:00
709beb6cf9
Add support for TestInterfaceMode to EthernetTracker
This change passes TestInterfaceMode into EthernetTracker.

It also introduces a small change to isValidTestInterface (so it
consistently returns true / false independent of whether test interfaces
are currently included).

This seems more consistent. Also note that a device is already
effectively prevented from configuring "testtap" interfaces by itself as
otherwise EthernetManagerTest (and various other tests relying on tap
interfaces) would break.

Test: atest EthernetManagerTest
Flag: EXEMPT mainline
Change-Id: I12e4d492d7c00d049ca44663c361c12c4262c7bc

Patrick Rohr   commited 2025-07-23 11:21:22 -07:00
3b8377fbc7
Move call to setEthernetEnabled inside setIncludeTestInterfaces
setIncludeTestInterfaces() pretty much always requires a call to
setEthernetEnabled(currentState) afterwards as a synchronization
mechanism. Add this call directly inside the helper function for
simplicity.

Test: TH
Flag: EXEMPT mainline
Change-Id: I4c787e9c560ffe60c981ac2e2a730e96138707cb

Patrick Rohr   commited 2025-07-23 10:55:07 -07:00
e9d1d080db
Create CommonConnectivityJni to share between modules
Flag: EXEMPT mainline
Test: TH
Change-Id: Ia85dfd3d979803baca9e971d1083f54dff46de53

Jimi Chen   commited 2025-07-23 05:47:12 +00:00
e5a4e6b0ba
Add EthernetPortSelector class
This patch added EthernetPortSelector class that is used to select a
specific ethernet port by interface name or MAC address.

Bug: 397536853
Test: atest ConnectivityCoverageTests
Flag: EXEMPT mainline
Change-Id: I050dc1f484115fdedda349cc2e1a44f4c5fda6db

Chuwei He   commited 2025-07-22 04:52:05 -07:00
66fef2ea8e
Merge "Use beta flag for bluetoothTetheringRandomizedAddress" into main
Motomu Utsumi   authored and   Android (Google) Code Review   commited 2025-07-17 15:35:10 -07:00
5286486f3b
Use beta flag for bluetoothTetheringRandomizedAddress
Bug: 287177081
Test: TH
Flag: com.android.tethering.mainline.beta.bluetooth_tethering_randomized_address
Change-Id: I1de9f4bb15c8423f09381a0c7513f0d7ebf80856

Motomu Utsumi   authored and   Hao Liu   commited 2025-07-17 21:30:07 +00:00
4b4f3018a5
Reapply "Fix EthernetManagerTest"
This reverts commit f28878b120.

Reason for revert: The original change was incompatible with
ag/34622357. Reapplying the fixed CL.

Bug: 432497516
Change-Id: I1b19b3336a4c938ef1adbd12c50a11903d373194

Patrick Rohr   commited 2025-07-17 11:32:44 -07:00
bdee78a22e
Revert "Fix EthernetManagerTest"
This reverts commit e9dcc62d2d.

Reason for revert:  DroidMonitor: reverting due to http://b/432497516. I will verify through ABTD before revert submission. 

https://buganizer.corp.google.com/issues/432497516#comment6

Bug: 432497516
Change-Id: I4773c0493137367cb0d4167eab535e0d827956ee

Liana Kazanova (xWF)   commited 2025-07-17 11:22:23 -07:00
f28878b120
Merge changes I6fb98e87,I3f61b474 into main
* changes:
  Delete unused TestInterfaceStateListener
  Reset EthernetManagerTest to reintroduce InterfaceStateListener

Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-07-17 09:33:42 -07:00
7134b8ca22
Fix EthernetManagerTest
This patch fixes EthernetManagerTest as follows:
(1) testEnableDisableInterface_disableEnableEthernet
    Fix the test error when USB interface is present and treated as
    ethernet interfaces.
(2) testRemoveInterface_disableEnableEthernet
    Fix the error When tethering interface already presents.

Bug: 427055553
Test: atest ConnectivityCoverageTests
Flag: EXEMPT mainline

Change-Id: I2a31f3f0434b35e9ebe96b4f7003e5a9be0d3e81

Chuwei He   commited 2025-07-17 14:50:26 +09:00
e9dcc62d2d
Reset EthernetManagerTest to reintroduce InterfaceStateListener
The previous changes to move EthernetStateListener and
InterfaceStateListener introduced 2 separate ArrayTrackRecords. This
test explicitly uses a single TrackRecord for both callbacks, so their
respective ordering can be tested.

This change resets EthernetManagerTest to the last known good state
(57fdd00cc7).

Test: TH
Flag: EXEMPT mainline
Change-Id: I3f61b474ff900ff44a366ed3ebd20f4d83f6bf7b

Patrick Rohr   commited 2025-07-16 11:21:08 -07:00
576677cc5e
Merge changes I332c8d43,I340bcb77 into main
* changes:
  Simplify APF IGMPv3 general query offload test
  refactor: Lazy load IP addresses for APF tests

Jimi Chen   authored and   Android (Google) Code Review   commited 2025-07-16 07:38:59 -07:00
5904ce1431
Simplify APF IGMPv3 general query offload test
Reduce the number of multicast addresses used in
`test_igmpv3_general_query_offload` to simplify the test case and
focus on the core functionality.

Flag: EXEMPT mainline
Bug: 419427388
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV6Test
Change-Id: I332c8d43bd89a444728ed7ebde3f4e064e4e39aa

Jimi Chen   commited 2025-07-16 04:31:44 +00:00
e42fb901b9
refactor: Lazy load IP addresses for APF tests
Previously, IPv4 and IPv6 addresses were retrieved in `ApfTestBase.setup_class`,
which meant all APF tests assumed the presence of both.

This change refactors `ApfTestBase` to introduce dedicated methods:
- `get_and_expect_ipv4_addresses_exist()`
- `get_and_expect_ipv6_addresses_exist()`

These methods now handle the retrieval and assertion of IP addresses.
Individual test cases in `ApfV6Test` are updated to call these methods
only when the respective address type is required for the specific test
scenario.

This improves test robustness by ensuring tests only depend on the
necessary IP addresses, allowing for more precise test setup and failure
reporting. Additionally, the doze mode activation is reordered to occur
after initial network setup.

Flag: EXEMPT mainline
Bug: 419427388
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV6Test
Change-Id: I340bcb77fe66cc9927dcd58e5899cdf9a4375daa

Jimi Chen   commited 2025-07-16 04:31:40 +00:00
419e088796
Merge "Add metrics for QUIC connection close" into main
Motomu Utsumi   authored and   Android (Google) Code Review   commited 2025-07-15 20:32:42 -07:00
e5d4a0fca3
Disconnect a network if it's suspended for 5 minutes for wear
The suspension state is designed to be a transient state. Implement an
enforcement to disconnect the network after staying at this state for 5
minutes. This can avoid apps unnecessarily waking up the device for
network activities even when there's no network actually connected.

Test: unit tests. Locally tested with a signal blocking bag.
Bug: 404570281
Flag: EXEMPT mainline
Change-Id: I1427a72402f7ec64eda537a89c86768466a72328

Hongyi Zhang   commited 2025-07-15 09:39:37 -07:00
3dcb3c5890
Add metrics for QUIC connection close
Test: QuicConnectionCloserTest
Flag: EXEMPT mainline
Bug: 311792075
Change-Id: I2bd9108c1f8af89824bf48767fcca9a1e1d57831

Motomu Utsumi   commited 2025-07-15 17:10:56 +09:00
504fe27b86
Merge "Search for the satellite opt-in flag in disabled services" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-07-14 20:41:48 -07:00
c5cda84789
Revert^2 "Fix onActiveDataSubscriptionIdChanged is not received in multi SIM mode"
This reverts commit 1bcbb88955.

Reason for revert: fix TelephonyCallback in multi SIM mode

Bug: 430233890
Change-Id: Ibfdc5546083132c504ac129256f321dd000b890c

Jimi Chen   commited 2025-07-13 20:05:43 -07:00
b588948892
Merge "Implement opt-in to custom tabs in captive portals." into main
Yuyang Huang   authored and   Android (Google) Code Review   commited 2025-07-13 03:24:56 -07:00
c0ad26d21b
Implement opt-in to custom tabs in captive portals.
This will allow portal operators to opt-in to custom tabs in
captive portal, either across the board with "true" or with
a version of the module above which it wants to opt-in.

Ideally there could be a separate key to also list opted-in
browsers and their versions, but this would become a lot
more complex. To start with, there is no place in
CaptivePortalData to store this kind of info, and that would
mean adding API which would have to be supported forever.

The constant inside the source represents a capport source that
contains the custom tabs opt-in. This is not a great place to put
this information in, but it has the characteristics of a benign and
useful hack :
- Time to market is 0
- It's easy to remove once we have a better API
- It's not a large problem if it's never cleaned up

Also, allowing to choose the browsers and the versions would
be uncomfortable since the choice of the browser is the user's
choice. On the one hand it does make some sense that the
operator could test with a given browser, see the UX is not
well adapted, and reject it, but on the other hand giving the
operator the choice of what browser the user can choose to
use on their portal is disputable, as this should generally be
under the control of the user.

In any case even if we decided to add a per-browser version
check it should be done in some other change.

Test: manual
Flag: EXEMPT opt-in feature
Change-Id: I540f4fcb6fb26f7f18077d9c8d06e5f7df206056

Chalard Jean   commited 2025-07-11 15:03:51 +09:00
f2cb190a73
Merge "Add UID to NSD metrics" into main
Yuyang Huang   authored and   Android (Google) Code Review   commited 2025-07-10 17:38:22 -07:00
3fc71d986b
Merge "Refactor: Add RestoreEthernetRule for ethernet tests" into main
Junyu Lai   authored and   Android (Google) Code Review   commited 2025-07-10 03:58:40 -07:00
f693a0f9bf
Refactor: Add RestoreEthernetRule for ethernet tests
This is a no-op, test only refactoring.
Move ethernet state management logic from EthernetManagerTest into a
dedicated JUnit test rule, RestoreEthernetRule. This new rule is
responsible for saving the initial ethernet state, allowing tests to
enable or disable it, and restoring the original state upon test
completion.  This refactoring simplifies EthernetManagerTest and
promotes code reuse.

Flag: EXEMPT EXEMPT test only refacotring
Test: atest NetworkStaticLibTests:com.android.testutils.RestoreEthernetRuleTest \
      CtsNetTestCases:android.net.cts.EthernetManagerTest --update-device
Bug: 410731080
Change-Id: If3dd869d6af4e0c659386621fb5d92012aa574d1

Junyu Lai   commited 2025-07-10 15:25:15 +08:00
9f6a566d89
Search for the satellite opt-in flag in disabled services
As it might be necessary to discover the metadata in services
for technical reasons, a good way to file that data is to make a
phony, disabled service for the purposes of containing this
metadata.

Unfortunately, the disabled components are not returned by
PackageManager unless you pass MATCH_DISABLED_COMPONENTS
as a flag, and we didn't know that at the time.

Do match disabled components so a disabled service can be used
as a holder for this.

Bug: 427846736
Test: manual
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.SatelliteAccessControllerTest
Flag: EXEMPT bugfix
Change-Id: Id32c32ab8cfb93a4270795a5bdf75edb4cb7a1f6

Chalard Jean   authored and   Junyu Lai   commited 2025-07-10 14:27:43 +08:00
21575cf8dd
Add UID to NSD metrics
This commit introduces the UID to the NetworkNsdReportedMetrics,
allowing for the association of NSD metrics with the specific
application or process that initiated the NSD operation.

Bug: 427689120
Test: atest ConnectivityCoverageTests NsdManagerTest
Flag: EXEMPT refactor
Change-Id: I780cd6ba74d2ef7e23200f83f497691dd4702919

Paul Hu   commited 2025-07-10 03:47:50 +00:00
924f535b56
Merge changes I65fecdcd,I0acc9fcb into main
* changes:
  Add pre-test check for APF offload status
  Add util to get APF offload config

Jimi Chen   authored and   Android (Google) Code Review   commited 2025-07-08 20:24:46 -07:00
df4c09fe3a
Merge "Test that IPsec Transport Mode Rekeying Works" into main
Nathan Harold   authored and   Android (Google) Code Review   commited 2025-07-08 13:06:39 -07:00
9b076e1e9d
Merge "Revert "Fix onActiveDataSubscriptionIdChanged is not received in multi SIM mode"" into main
Liana Kazanova (xWF)   authored and   Android (Google) Code Review   commited 2025-07-08 12:30:14 -07:00
4979bd960b
Revert "Fix onActiveDataSubscriptionIdChanged is not received in multi SIM mode"
This reverts commit aecb2b65ba.

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

Bug: 430219293
Change-Id: I9b786abf784de8c34b9f517236305330b79b227e

Chaitanya Cheemala (xWF)   authored and   Android (Google) Code Review   commited 2025-07-08 03:54:19 -07:00
1bcbb88955
Merge "Fix onActiveDataSubscriptionIdChanged is not received in multi SIM mode" into main
Jimi Chen   authored and   Android (Google) Code Review   commited 2025-07-07 21:57:41 -07:00
7e816d5d07
Add pre-test check for APF offload status
This commit introduces a verification step that runs before APF
offload tests.

It uses the `cmd network_stack apf <iface> config` shell command
to dump the list of enabled offloads. By checking this list first,
we can ensure that the specific offload under test is actually
enabled, avoiding misleading failures and improving test reliability.

Flag: EXEMPT mainline
Bug: 419427388
Test: ./cts-tradefed run commandAndExit cts -m CtsConnectivityMultiDevicesTestCases -t ApfV6Test --shard-count 2
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV6Test
Change-Id: I65fecdcd4f2f9e9586da2684bf68cec215d0f359

Jimi Chen   commited 2025-07-08 04:11:22 +00:00
af1e460e26
Fix onActiveDataSubscriptionIdChanged is not received in multi SIM mode
Flag: EXEMPT mainline
Bug: 428673855
Test: manually
Change-Id: I0d7c2538ec33402dba64949c3fb34519605d843e

Jimi Chen   commited 2025-07-08 02:14:21 +00:00
aecb2b65ba
Merge changes I667e3607,Iacd9236f into main
* changes:
  Refactor: Introduce TestableCallback for EthernetStateListener
  Refactor: Move EthernetStateListener to a standalone file

Junyu Lai   authored and   Android (Google) Code Review   commited 2025-07-07 19:08:22 -07:00
ccf66834c6