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
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
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
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
updateConfiguration() does not affect the interface / network in NCM
mode.
Test: TH
Flag: EXEMPT mainline
Change-Id: Ie865a1393e55cead622719dd768c456b8337b853
* changes:
Add support for TestInterfaceMode to EthernetTracker
Move call to setEthernetEnabled inside setIncludeTestInterfaces
Add support for TestInterfaceMode in setIncludeTestInterfaces
Treehugger Robotauthored and Android (Google) Code Reviewcommited 2025-07-23 14:16:42 -07:00
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
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
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
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
This reverts commit f28878b120.
Reason for revert: The original change was incompatible with
ag/34622357. Reapplying the fixed CL.
Bug: 432497516
Change-Id: I1b19b3336a4c938ef1adbd12c50a11903d373194
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
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
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
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
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
This reverts commit 1bcbb88955.
Reason for revert: fix TelephonyCallback in multi SIM mode
Bug: 430233890
Change-Id: Ibfdc5546083132c504ac129256f321dd000b890c
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
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
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 Jeanauthored and Junyu Laicommited 2025-07-10 14:27:43 +08:00
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
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
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