This adds tests for bugs that were introduced when we enabled
early native network creation. The tests pass on current builds
because the feature is disabled, but break if the feature is
re-enabled without fixing the races.
Specifically:
- Add a test that registers/unregister/registers agents in a
loop. This checks for a race between unregister() and
register() which exists because unlike register(),
unregister() has to wait for the agent channel to be
connected.
- Add a test for calling unregisterAfterReplacement multiple
times on the same interface. This tests for the race seen
in b/286649301#comment6 , where calling
unregisterAfterReplacement twice and then registering a third
agent will cause the second agent to be torn down after the
third is registered.
Bug: 296355968
Test: test-only change
Change-Id: I3d798209740273e5ce59b278af41dd2ad9470916
Lorenzo Colitticommited 2024-10-31 16:26:14 +09:00
This is a no-op change since the config is not used yet, and
the feature flag will be gradually rolled out instead of enabled
by default.
However, this change is necessary for follow-up changes to enable
toggling the feature and configuring its behavior through device
configuration flags.
This change includes:
1. Disable the service-side cache flag if the client-side flag
is enabled.
2. Since the apps don't have enough permission to check the
feature flag from DeviceConfig. Provides a binder interface
for returning per-UID config,
which only returns cache enabled if the SDK level is V+
or the app's target SDK is V+.
Test: atest FrameworksNetTests:android.net.connectivity.android.net.TrafficStatsTest \
FrameworksNetTests:android.net.connectivity.com.android.server.net.NetworkStatsServiceTest \
CtsNetTestCases:android.net.cts.NetworkStatsBinderTest \
FrameworksNetIntegrationTests:com.android.server.net.integrationtests.NetworkStatsIntegrationTest
Bug: 343260158
Change-Id: Id9761e4aea65fabe6466c875b787e178317a1da2
Follow-up from aosp/3249945. If the system caller queries stats
for other UIDs, the caller would get UNSUPPORTED.
This follows the official documentation, where the API would
not return stats for all other UIDs.
However, partners or other legacy callers might already depend
on this undocumented behavior. Changing this behavior might
damage existing apps.
Thus, this change reverts the behavior change introduced at
aosp/3249945 and allows a system caller to query stats for
other UIDs.
Test: atest ConnectivityCoverageTests:android.net.connectivity.android.net.TrafficStatsTest
Bug: 372851500
Change-Id: Ia7ea051f7b0b6349ffcb890c300362bbfbdee3dc
24Q2 reconnects mobile data when Wi-Fi is toggled when IWLAN is used,
which breaks multinetwork tests. Disable IWLAN as a workaround on such
builds.
Bug: 368477391
Test: atest
Change-Id: Ia5748dc2378c5fc4a43ff83e6b47e629eb8bf77a
This CL adds new test cases for verifying the Thread Border Router's
DNS Recursive Resolver feature: The DNS clients resolves google.com
successfully when the feature is enabled.
Bug: 354868095
Test: atest ThreadNetworkIntegrationTests:android.net.thread.InternetAccessTest
Change-Id: I1b021151c6843b30c3f47559ab20dec405af5dea
Networks can use widely varying timeouts for their connections. Because
cellular modems use a lot of power, having this configurable is more
useful for tuning this to an optimal value for power drain.
Adding a similar configurable value for WiFi for parity.
Test: atest ConnectivityCoverageTests:\
android.net.connectivity.com.android.server.CSNetworkActivityTest
Bug: 373733012
Change-Id: I2418f09233b2e3fa4e9cdd8fbb6149a35106b735
The APIs were not deleted to support the CTS before R5 test. Now that CTS R5 (without calling the APIs) is rolled out, we can remove these APIs.
Test: -m
Fix: 286137024
Bug: 376002171
Change-Id: I0812792b445a30a9cd366b41515dd39b981ef5d3
This helper is available on 5.1+ kernels and required to read certain
fields (like the mark) from skb->sk.
Test: TH
Change-Id: I96087c9974262594fdcb4119cbdbd1b39c26a5d4
The current implementation uses MANAGE_USERS, CREATE_USERS, or
QUERY_USERS to check if the user is an admin. However,
QUERY_USERS is not a privileged permission until Android U.
This can cause issues on devices running older Android versions
(e.g., T) where the tethering module requires this check but
doesn't have the necessary permission, leading to crashes.
This change updates the code to use MANAGE_USERS, a privileged
permission since 2015, to reliably determine if the user is
an admin across different Android versions.
Test: Manual on T device:
1. Mock entitlement and enable hotspot
2. Check granted permissions of android.uid.networkstack
Fix: 366816004
Change-Id: Iee060f0225d23c62d836f0211c63b649e539f77b
Currently, if the app's target SDK is V+, the rate-limit cache is
enabled regardless of whether the kill switch is enabled or not.
This creates problems if there is a need to disable the feature
entirely.
Thus, this change makes the kill switch override the target SDK
level. This is necessary for follow-up changes to enable
the client-side cache and disable the service-side cache
simultaneously.
This change also removes the need of initializing/clearing the
caches when the cache is entirely disabled.
Test: atest FrameworksNetTests:android.net.connectivity.android.net.TrafficStatsTest \
FrameworksNetTests:android.net.connectivity.com.android.server.net.NetworkStatsServiceTest \
CtsNetTestCases:android.net.cts.NetworkStatsBinderTest \
FrameworksNetIntegrationTests:com.android.server.net.integrationtests.NetworkStatsIntegrationTest
Bug: 343260158
Change-Id: I38bdfe00220f59712ca4b095fe4e7a3731320708
This CL passes the DNS servers' information to ot-daemon which was
fetched from LinkProperties of the infra link. This can enable the DNS
recursive resolver feature of the Thread Border Router.
The integration test case will be covered when aosp/3259932 is merged. Currently the test case CL cannot be merged because the there's a dependency PR in GitHub hasn't been merged: https://github.com/openthread/openthread/pull/10864.
Bug: 365892457
Bug: 354868095
Test: atest ThreadNetworkIntegrationTests:android.net.thread.InternetAccessTest
Change-Id: I66e54715ecaf8e0a43324d4afd4398e8884d8738
The PacketReader should be stopped after the test completes.
Otherwise, it may lead to a memory leak due to the creation of
excessive file descriptors.
Test: atest NsdManagerTest
Change-Id: I3015dbe9d8a25e3370b32935787708e1e88fbbc7
This change includes:
1. Rename binder interfaces.
2. Use a dedicated class to pass the result of
get{Total|Iface|Uid}Stats, as it is 25% faster than passing
a NetworkStats object through the binder interface.
3. Remove the binder interface only used by the test.
4. Remove NetworkStatsBinderTest on R and S, since the binder
interface is removed, the mainlined service does not run on
those versions and the chance of breaking these tests on
R and S is low.
5. Remove useless TODO comments.
Test: atest FrameworksNetTests:android.net.connectivity.com.android.server.net.NetworkStatsServiceTest \
CtsNetTestCases:android.net.cts.NetworkStatsBinderTest \
FrameworksNetIntegrationTests:com.android.server.net.integrationtests.NetworkStatsIntegrationTest
Bug: 372851500
Bug: 343260158
Change-Id: Ibd79a17218f54f0117d8ef5d7b9ec6073356f923
This CL adds a switch to the Thread demo app that allows the user to enable or disable NAT64.
See screenshot https://screenshot.googleplex.com/3UDJ6wXqRf6WKRy.
Bug: 375559106
Change-Id: I2a5c9f08ef664e62a5c34987eedb321e2b01fd85
The log should help investigate flakes, by knowing at which point
DeviceConfig is being reset and to which value.
Test: atest
Change-Id: Ia7392ad57d3df17b0d5194158b402f52bc90f7e3
This changelist adds a new presubmit entry to be used to trigger this test module on automotive target with visible background user enabled (multi-user multi-display targets).
Bug: 374372313
Test: m
Change-Id: I3de5d9660cf472df0011e920c674da0e2895ef39
On some networks, telephony may teardown its network
(unregisterAfterReplacement) when wifi is toggled to change the MMS
capability.
Update testRejectUnvalidated_TearDownNetwork to take that into account:
right after toggling wifi to make it unvalidated, wifi may still be
default if mobile data is being reconnected. Wait for mobile data to
reconnect and validate in that case.
Bug: 296403855
Test: atest
Change-Id: Ief46bed41ecb23d75c9a1f58e7a272e7f3de7caf