Commit Graph

7 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
b5f0819d35 Move ConnectivityDiagnosticsManagerTest to common
The tests are also useful in CTS to ensure that the
ConnectivityDiagnosticsManager class API is implemented properly
(including behavior of the DataStallReport class for example).

Bug: 187935317
Test: atest ConnectivityDiagnosticsManagerTest
Original-Change: https://android-review.googlesource.com/1742075
Merged-In: I86f39238054f43403f9a1e383dd2a935de84f06f
Change-Id: I86f39238054f43403f9a1e383dd2a935de84f06f
2021-06-23 09:16:53 +00:00
Junyu Lai
cdb727ed50 Add CTS for registerNetworkOffer
Test: android.net.NetworkProviderTest on R/S device
Bug: 189074532

Original-Change: https://android-review.googlesource.com/1731451
Merged-In: Ic3ab3c487d8a9b5a9508b59f83ae35672307b933
Change-Id: Ic3ab3c487d8a9b5a9508b59f83ae35672307b933
2021-06-21 14:18:34 +00:00
Frank Li
b7eebde98a Add CTS test for API setLegacyExtraInfo
Adding in-depth test in NetworkAgentTest
Bug: 187040803
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkAgentConfigTest
      atest CtsNetTestCases:android.net.NetworkAgentConfigTest
Original-Change: https://android-review.googlesource.com/1719131
Merged-In: Ief14f6de0cb6913da944414f0b134eb04346425f
Change-Id: Ief14f6de0cb6913da944414f0b134eb04346425f
2021-06-17 13:00:57 +00:00
Junyu Lai
52e3fa127a Fix expectCallback does not fail when no callback received
This hides 3 bugs where,
  1. In Android S, onNetworkRequested is no longer broadcasted
     by ConnectivityService in any condition. However, the test
     still passes since assertion does not fail when no callback
     received. Ignore the test on S+ devices since the behavior
     changed on S or later devices.
  2. Test network agent is not registered, but the test still
     passes.
  3. Test network agent does not fulfill the request that kept
     the network up, so the test fails since the test network
     is not needed and be torn down.

Test: android.net.NetworkProviderTest on R/S device
Bug: 189074532
Merged-In: I627dcd0f57b6ef4197d16e6c1ec0c53e675ab055
Change-Id: I627dcd0f57b6ef4197d16e6c1ec0c53e675ab055
  (cherry-picked from aosp/1731450)
2021-06-17 09:03:11 +00:00
Chiachang Wang
54e7806acf Add test for NetworkCapabilities.Builder.withoutDefaultCapabilities
Bug: 186061922
Test: atest CtsNetTestCases:android.net.NetworkCapabilitiesTest
Merged-In: I369e71dd6ae85da78e114ea8377967ab0bde787b
Change-Id: I369e71dd6ae85da78e114ea8377967ab0bde787b
(cherry picked from commit 0f3913d998)
2021-05-21 07:54:46 +00:00
Remi NGUYEN VAN
3aee5b63e6 Move config_apf* resources to NetworkStack
The resources are only read by NetworkStack through their respective
ApfCapabilities SystemApi methods.
As the resources are being migrated out of frameworks/base resources
anyway, move them directly to NetworkStack instead of moving them to
ServiceConnectivityResources.

Also test that the framework resources are not overlaid or modified.
This should avoid OEM integration errors where the overlays are kept as
in R, without overlaying the resource in the NetworkStack package.

Bug: 185850634
Test: atest CtsNetTestCases
BYPASS_INCLUSIVE_LANGUAGE_REASON=Need to mention legacy APIs

Merged-In: I7a15ddcad5af11fa307d9dbe3a77b31a1179e5b3
(clean cherry-pick)

Change-Id: I7a15ddcad5af11fa307d9dbe3a77b31a1179e5b3
2021-05-19 11:00:58 +09:00
Remi NGUYEN VAN
65b8995a15 Move net unit tests to packages/Connectivity
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
2021-05-13 05:55:44 +00:00