This class doesn't actually serve a purpose, it only makes
TestableNetworkCallbck more complex.
Test: CtsNetTestCases ConnectivityCoverageTests
Flag: EXEMPT test-only
Change-Id: I39a598b82a3215384bdfe04980f4b280ab2c2716
Accounting for RS delay, a 2s timeout is not enough.
Test: TH
Flag: EXEMPT mainline
Bug: 416710891
Change-Id: I19e78f39c8d77e150792a36fe9c86791aac0c2f8
Without rule 5.5 this won't work correctly anyway. However, this tests
the behavior of the DHCPv6-PD client.
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: Ibd84883391926f4e19c0e3d370d28fbcb68c0b8e
This adds the basic structure for a full end-to-end test for DHCPv6-PD
using a tap interface. This tests the interaction between the DHCPv6-PD
client, IpClient, and Netlink callbacks, and the kernel.
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I6e56703187310ceaf6462b41f2e1ab3690faff01
Clat interface creation is not always part of the second
LinkPropertiesChanged callback. This change processes
LinkPropertiesChanged callbacks until the clat interface has been
created, or no more LinkPropertiesChanged callbacks are received.
Test: atest ClatTest
Flag: EXEMPT mainline
Bug: 410685868
Change-Id: I8ff2dd95efef8dab9dfde99a1617895317c728d5
Renames srcPort to sport and dstPort to dport and generates a random
port number in the range of [1, 65536) if no argument is passed.
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: If446cde9a7ff414f52c60f70458ff046a2c4dc33
This test brings up a tap interface and starts clat on it by responding
with an RA including a PREF64 option.
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: Idf8e58d56a322185c97495585ecddf2432f1c820
Adding mechanism to track interaface name to interface index, this map
would be used by BpfNetMaps for storing interface index.
Bug: 400681214
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.InterfaceTrackerTest
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.BpfNetMapsTest
Change-Id: I2a65cac908d9c4d10714e3fe26be20322d4a1db3
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
modules should specify the submodule of java_sdk_library that the module
actually depends on
Test: CI
Bug: 358613520
Change-Id: I0367068c901df98483f6cf95160d3e7801881b0a
This reverts commit ee96ba0e60.
Reason for revert: Droidmonitor triggered revert due to b/342557183. Will be verifying through ABTD before submission.
Change-Id: I7e185c3ac11da27c7bb9d95e4221f7dfc22cf48c
Priyanka Advaniauthored and Gerrit Code Reviewcommited 2024-05-24 18:11:45 +00:00
Currently, even if apps don't have INTERNET permission and can not use
network, network access is considered not blocked and
ConnectivityService send onBlockedStatusChanged callback with
blocked=false.
This CL introduced BLOCKED_REASON_NETWORK_RESTRICTED and consider
network access from apps targetting W+ on V+ releases is blocked if apps
don't have INTERNET permission.
Permission is set when the user is added or package is installed and
permission is removed when the user is removed or packages is
uninstalled.
So ConnectivityService does not need to monitor permission change to
send onBlockedStatusChanged callback by permission change.
Test: CSBlockedReasonsTest
Bug: 339559837
Change-Id: I58d2a4eddc714e205f5b96219f95b637f2826c58
Currently, TrafficStats have rate-limit on all get* APIs.
It is possible that result of uid traffic is updated but result
of iface is not. Thus, clear cache before read.
Test: atest CtsNetTestCases:android.net.cts.IpSecManagerTest#testIkeOverUdpEncapSocket --rerun-until-failure 100
Test: atest FrameworksNetIntegrationTests:com.android.server.net.integrationtests.NetworkStatsIntegrationTest
Bug: N/A
Change-Id: I1b7574d3062837fdded79cb945b582f2afad859b
add tests for ServiceManagerWrapper.java to coverage native NDK APIs
used in this module.
Bug: 330417869
Change-Id: Ibeb277fe1fea361b4e0fca58f3291d7fa925ab7f
When request_restricted_wifi is enabled CarrierPrivilegeAuthenticator
calls CarrierPrivilegesLost callback passed from ConnectivityService.
But CarrierPrivilegeAuthenticator was using its own handler thread to
receive broadcast and callbacks so CarrierPrivilegesLost callback needed
to post a message to the CS handler.
This CL updates CarrierPrivilegeAuthenticator to use CS handler if
request_restricted_wifi is enabled, and remove the message post in
ConnectivityService.
Test: TH
Change-Id: Ib41304a30e3dd366b0f6f1d7df81145f0e05ece1
Similarly to NetworkMonitorTest, terminate NetworkMonitor threads and
ExecutorServices after each test case in integration tests.
This should fix flakes where the HTTP probe from testValidation could
finish after mock probe responses are cleared in tearDown.
The utils used in NetworkMonitorTest are factored out to ConcurrentUtils
to achieve that.
Fixes: 292481238
Test: atest --rerun-until-failure 50
Change-Id: I5cdeee8d4f06ea40e338dd2cb1fdcc2fe0907a7d
Apps that target an SDK before V will not see networks with
NET_CAPABILITY_LOCAL_NETWORK unless they explicitly set this capability
in their network requests.
Bug: 319212206
Test: CSLocalAgentTests
Change-Id: I414b03dfea9a8aac83304c6be501f03d637739b4
Always store the corresponding SubscriptionId together with the Carrier
uid so that when the carrier loses the Privilege, both the uid and
SubscriptionID will be used in the onCarrierPrivilegesLost callback
Bug: 324357121
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.CarrierPrivilegeAuthenticatorTest
atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.ConnectivityServiceTest
Change-Id: I28e51c583261a67d4441c6f825ade6781b862ee4
- Implement handleSetSatelliteNetworkPreference() at ConnectivityService
to create multi layer request with preference order
PREFERENCE_ORDER_SATELLITE_FALLBACK.
- unit test coverage
Bug: 320514105
Test: m and atest FrameworksNetTests
Change-Id: I3f71104f8c3c998599eaab71ae4076985f4bed77
This CL allows the Carrier Config app to request restricted WiFi nework
by setting the correspoding subscription ID in the network request.
Bug: 315835605
Test: atest android.net.cts.NetworkRequestTest
atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.CarrierPrivilegeAuthenticatorTest
atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.ConnectivityServiceTest
Change-Id: I237e692d092ff5f969ce4b7962f6d58099a6f3a9
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.
For more details please refer to the link below,
<add g3 doc link>
Bug: 304529413
Test: N/A
Change-Id: I243f17b3f0ad7af9ffa15ca242456e36688733f5
Merged-In: I243f17b3f0ad7af9ffa15ca242456e36688733f5
Fix current leaks in ConnectivityServiceIntegrationTest, which leaked
the ConnectivityService and CarrierPrivilegeAuthenticator handler
threads, and enable the checks.
Using @DevSdkIgnoreRunner.MonitorThreadLeak ensures that tests properly
cleanup threads (in particular handler threads), as many leaked threads
could affect other tests.
Bug: 310659032
Test: atest --rerun-until-failure 20
Change-Id: Ia62d33d86217fef1d03532bb51c890a90430a70e
ConnectivityServiceTest creates hundreds of NetworkAgentWrapper, without
stopping their HandlerThread. This leaks a lot of threads while tests
are running.
Ensure the threads are stopped in ConnectivityServiceTest, and
integration tests that also use NetworkAgentWrapper.
Test: atest, watch adb shell ps -T [test package pid]
Bug: 310659032
Change-Id: I34f367b2efe3d05e1db5eab4c9fd93ee79c1b683
The issue arises when the network becomes validated based on the
isCaptivePortal success with HTTPS, even though the HTTP probe
hasn't been executed yet. Given that there is no way to ensure
HTTP probe was sent in this case, the pass condition should be
relaxed, allowing a single https query instead of expecting both.
Test: atest FrameworksNetIntegrationTests:ConnectivityServiceIntegrationTest#testValidation \
--rerun-until-failure 100
(With hardcoded sleep when starting HTTP probe)
Fix: 303351630
Change-Id: I580e9a3a868cd0b3395a20ace27b006529475312
This is useful to ensure cgroup bpf program is attached,
which would lead to hard-debugging uid stats missing problem.
Test: atest ConnectivityServiceIntegrationTest#testBpfProgramAttachStatus
Bug: 292156770
Change-Id: I16370497484aff29ed41cbb0d160e530731e1a4e
This sets up what is necessary for an instrumented
ConnectivityService to run. Users of this class are
meant to inherit CSTest.
This is still relatively basic and does not have all the
instrumentation in ConnectivityServiceTest. Developers
looking to extend CSTest may find some instrumentation
missingĀ ; when they add the missing instrumentation,
they should consider whether it should be generic for all
CSTests (and put it in base/), or whether it's local to
their own test suite. This should enable faster testing
as each CSTest children will only need to set up the
instrumentation it actually needs.
This patch also migrates a basic test to have a first user.
Bug: 272685721
Test: ConnectivityServiceTest
CSBasicMethodsTest
Change-Id: I1c47f616af90629c9cb2a6ae89d992b19863e704
Fix kotlin nullable errors that were exposed by setting the retention
of android.annotation.NonNull and android.annotation.Nullable to
class retention.
Bug: 294110802
Test: builds
Change-Id: Id49e4a2ee0b7b463d99bce6eb22919b84c21443a
Move the test component configuration from subdirectories
to the common OWNERS file. This ensures that all test directories
like unit/ that did not have the component set are covered.
Bug: 288137916
Change-Id: I48fbe846309cace41588c5ff3dfd46e878c38576
Test: TH
The ConnectivityResources class is only usable with QUERY_ALL_PACKAGES
permission, so it is not generally usable in framework-connectivity. It
is also backed by the ServiceConnectivityResources APK, which is
intended as resources for service-connectivity.
Move the class to service-connectivity and update callers. CTS needs a
way to determine the supported keepalive count as it used the
resources from KeepaliveUtils as @hide API, so provide a
ConnectivityManager @hide API for testing.
Bug: 279108992
Test: atest
Change-Id: I3c9a77c580b5ab87c922c32778bce15dc33b4d1d
Remi NGUYEN VANauthored and Motomu Utsumicommited 2023-04-28 19:18:39 +09:00
Instead of NetworkStackApiStableShims, use NetworkStackApiCurrentShims
as this is a development branch.
Use java_defaults in the "merge conflicts expected" section, so that
module release branches can use the same defaults, but set it to
NetworkStackApiStableShims.
The shims are removed from FrameworksNetIntegrationTests, as they are
already available there through service-connectivity-pre-jarjar. Keeping
them as a dependency would make FrameworksNetIntegrationTests use both
Stable shims (directly) and Current shims
(through service-connectivity-pre-jarjar).
Bug: 266205506
Test: m
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:921290b49d109360aae5dc39effaa3b0e691f65a)
Merged-In: I88228152834a1c06830fb51e868fb8e3d8c47519
Change-Id: I88228152834a1c06830fb51e868fb8e3d8c47519
Remi NGUYEN VANauthored and Motomu Utsumicommited 2023-03-27 15:56:23 +09:00
The base method is capable of doing this in a clearer manner,
so this redundant method is no longer needed.
Test: ConnectivityServiceTest FrameworksNetIntegrationTests
Bug: 157405399
Change-Id: I5f801d3c66374096fe7be7be21ee8d80264cd693
Test: FrameworksNetTests
adb shell device_config put connectivity actively_prefer_bad_wifi
+ check that dumpsys updates
Test: at this patchset tests fail with :
Permission denial: reading from settings requires:android.permission.READ_DEVICE_CONFIG
Change-Id: Icfe1e64b8313921ff1dc8e4cbd45f967692e1c4a