Move the tests together with packages/Connectivity code, so both can be
moved to packages/modules/Connectivity together.
Also reorganize unit tests in a unit/ directory, as other tests
(integration/, common/ etc.) have been added in tests/net since they
were created. This makes the directory structure consistent.
Test: atest FrameworksNetTests
Bug: 187814163
Merged-In: I254ffd1c08ec058d594b4ea55cbae5505f8497cc
Change-Id: I254ffd1c08ec058d594b4ea55cbae5505f8497cc
Move the tests together with packages/Connectivity code, so both can be
moved to packages/modules/Connectivity together.
Also reorganize unit tests in a unit/ directory, as other tests
(integration/, common/ etc.) have been added in tests/net since they
were created. This makes the directory structure consistent.
Test: atest FrameworksNetTests
Bug: 187814163
Ignore-AOSP-First: needs per-branch move for merge conflicts
Change-Id: I254ffd1c08ec058d594b4ea55cbae5505f8497cc
Create *LatestSdk variant build target which have target sdk specify
to allow test apk install to released platform.
Bug: 182211575
Test: test S MtsTetheringTest in R device
Change-Id: I4d5c5e8c3d74993a67380e0211da31884cbf8792
These tests are currently broken due to what appears to be an
upstream regression affecting 5.10 kernels, and are causing
all networking CLs to fail presubmit.
Skip them in presubmit until the regression is fixed. The tests
will still fail when run manually or in postsubmit.
Bug: 186608065
Test: atest CtsNetTestCases:android.net.cts.IpSecManagerTest
Change-Id: Ib78e13ace62a0addddff0a2d17b7f393a4cc4f87
The type of ConnectivityManager#PRIVATE_DNS_MODE_OPPORTUNISTIC
has changed from String to int, but the String definition is still
needed to update to Settings.Global.PRIVATE_DNS_MODE, so the
simplest way is to define one locally.
Bug: 185311744
Test: atest CtsNetTestCases
Change-Id: Iafcd861714d8aca44cede658ed630f9d5afd5e59
Merged-In: Iafcd861714d8aca44cede658ed630f9d5afd5e59
(Cherry-picked from ag/14232792)
Per documentation at the sdk website, the instant app mode
does not have the permission that is needed to get test network.
Thus, ignore test in instant app mode.
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest#testRequestBackgroundNetwork \
--instant
Bug: 185927087
Change-Id: Ic7bf230349c2a17ac485a72416b294dba81dac06
ConnectivityManager.setGlobalProxy() requires NETWORK_STACK
permission. Add test to verify exception thrown if caller has
no permission.
Bug: 186061922
Test: atest CtsNetTestCases CtsNetTestCasesLatestSdk
Change-Id: I87e2e6a878bd538b2e8c6f72f44335746151a9a7
DEVICE_INITIAL_SDK_INT does not exist in older SDKs: use the pre-rename
field, FIRST_SDK_INT instead.
Fixes: 185731191
Test: atest ConnectivityManagerTest#testSocketKeepaliveLimitTelephony
Ignore-AOSP-First: Needs cherry-picks
Change-Id: I1fbc0f714d539a664c053cb9cf1f86c3e651c5a2
The type of ConnectivityManager#PRIVATE_DNS_MODE_OPPORTUNISTIC
has changed from String to int, but the String definition is still
needed to update to Settings.Global.PRIVATE_DNS_MODE, so the
simplest way is to define one locally.
Bug: 185311744
Test: atest CtsNetTestCases
Change-Id: Iafcd861714d8aca44cede658ed630f9d5afd5e59
Ignore-AOSP-First: In the same TOPIC, there is a merge conflict in
DevicePolicyManagerService.java in the internal branch, so it's needed
to merge the code into internal branch to fix the merge conflict.
Update the usage in callers side for
- Rename NetworkAgent#setTeardownDelayMs to
NetworkAgent#setTeardownDelayMillis
- Use getters instead of fields in VpnTransportInfo
- Rename registerDefaultNetworkCallbackAsUid to
registerDefaultNetworkCallbackForUid in ConnectiivityManager
Bug: 183972850
Bug: 185246410
Fix: 184735863
Test: atest FrameworksNetTests
Test: atest CtsNetTestCasesLatestSdk
Change-Id: Ie542e5ad631388d9948dd27de21bc218b5b5b8f2
Merged-In: Ie542e5ad631388d9948dd27de21bc218b5b5b8f2
As a temporary measure to get the test to pass, use the
QUERY_ALL_PACKAGES permission when calling getSupportedKeepalives.
This is helps as getSupportedKeepalives obtains the configuration
from resources in the connectivity resources package, which
recently got its own non-platform certificate and is now not
visible from the test anymore.
getSupportedKeepalives is only used by tests and ConnectivityService
which has all permissions.
The actual fix should make sure getSupportedKeepalives does not require
such a permission (although getSupportedKeepalives is not a formal API),
but this will take more time and the test needs to stay green in the
meantime.
Bug: 186093901
Test: atest CtsNetTestCases
Change-Id: I288ec13a6f0840b184f1c919785724733ca56adf
Build NetworkRequest using builder from an existing
NetworkRequest is exposed to API surface, so add a test to
verify its behavior works as expectation.
Also, create a TestUtils in the cts to put the multiple
reference methods(shouldTestSApis) to prevent duplication.
Bug: 186061922
Test: atest CtsNetTestCases:android.net.cts.NetworkRequestTest
in current sdk
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.NetworkRequestTest
in R and current sdk
Test: atest android.net.cts.ConnectivityManagerTest#\
testRegisterNetworkCallback
Change-Id: I46318e212d51e4e13efa86e8b9c3ca7326d62b77
Update the usage in callers side for
- Rename NetworkAgent#setTeardownDelayMs to
NetworkAgent#setTeardownDelayMillis
- Use getters instead of fields in VpnTransportInfo
- Rename registerDefaultNetworkCallbackAsUid to
registerDefaultNetworkCallbackForUid in ConnectiivityManager
Bug: 183972850
Bug: 185246410
Fix: 184735863
Test: atest FrameworksNetTests
Test: atest CtsNetTestCasesLatestSdk
Change-Id: Ie542e5ad631388d9948dd27de21bc218b5b5b8f2
Ignore-AOSP-First: Prevernt build break by automerger