Commit Graph

13 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
7e23f18158 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
Change-Id: I86f39238054f43403f9a1e383dd2a935de84f06f
2021-06-21 19:33:28 +09:00
Remi NGUYEN VAN
c9c745f2f2 Make tests compatible with mockito-extended
This does not change the mockito library to use mockito-extended in
FrameworksNetTests, but changes the tests so that they would pass if
built against that library.

This is useful to run FrameworksNetTests in a common test suite with
other tests that use mockito-extended, for example a common connectivity
coverage test target.

The change includes increasing the test timeout in
ConnectivityServiceTest, as mockito-extended can have performance impact
(~3 times on hwasan builds). This change does not make tests run slower
in the current FrameworksNetTests suite though.

Bug: 187935317
Test: atest FrameworksNetTests
Change-Id: I61fa371e8957037075a2617a014647ff062207c6
2021-06-16 17:53:08 +09:00
Remi NGUYEN VAN
efdffa82f8 Merge "Fix KeepalivePacketDataUtilTest crash on eng build" 2021-06-15 07:08:23 +00:00
Les Lee
a0592d3e06 Add unit test when querying TYPE_WIFI + null/empty/non-null subscriberId
Starting with API level 31, the subscriberId is applicable
for the wifi network. Considering applications may use
null or an empty string as subscriberId (for instance, cts),
frameworks create MATCH_WIFI_WILDCARD NetworkTemplate when querying
wifi network with null or an empty string which is the behavior before
API level 31.

Bug: 188915450
Test: atest -c NetworkStatsManagerTest
Change-Id: Id4ae06840e1749997e970b8f1ec391060967bd47
2021-06-15 12:04:23 +08:00
Remi NGUYEN VAN
b397b5645a Fix KeepalivePacketDataUtilTest crash on eng build
The test causes a Log.wtf to be logged, because it tests a method that
should not be used after R. Mock the terrible failure handler to avoid
crashes on eng builds.

Test: atest KeepalivePacketDataUtilTest

Change-Id: Ic06a0db7fefb4acf38b66feba9b47e21f9927b1c
2021-06-14 18:13:39 +09:00
xingdai
892a0ef152 Revert "Use mockito-extended in FrameworksNetTests"
This reverts commit 98b76cc2ec.

Reason for revert: <INSERT REASONING HERE>

b/190622577

Change-Id: Ief39f82875e6fa885829aea62eed00f2f2e6774e
2021-06-10 21:41:54 +00:00
Remi NGUYEN VAN
98b76cc2ec Use mockito-extended in FrameworksNetTests
This is necessary to mock classes like BatteryStatsManager, which cannot
be used without signature permissions, and to merge the test with other
test suites that use mockito extended.

Bug: 187935317
Test: atest FrameworksNetTests
Change-Id: I5dba65d806c5d06b3ff8f633846edb911a7a44ec
2021-06-08 19:12:09 +09:00
Yan Yan
70a118d80d Merge "Improve IKEv2/IPsec VPN by proposing more IPsec algorithms" 2021-05-21 22:00:30 +00:00
Yan Yan
86783c3711 Improve IKEv2/IPsec VPN by proposing more IPsec algorithms
This commit allows IKEv2/IPsec VPN to propose more algorithms that
newly added in IpSecAlgorithm. Those new algorithms have stronger
security guarantees and better performances.

This commit also removes algorithm name validation because all
algorithms are URL encoded to ensure no special characters create
problems due to their use by VpnProfile for list or field delimiting
(e.g. rfc7539esp(chacha20,poly1305))

Bug: 185265778
Test: atest FrameworksNetTests, CtsNetTestCases
Test: All new algorithms are manually verified
Change-Id: I1de322c95aacc8924e95bcdbcfdbd1ec441de99c
2021-05-21 17:46:54 +00:00
Les Lee
e14af82411 Merge "Add metered filter for API: buildTemplateCarrier" 2021-05-18 13:01:38 +00:00
lesl
70d9ccdc9b Add metered filter for API: buildTemplateCarrier
This CL modifies NetworkTemplate#buildTemplateCarrier to force on
metered carrier network and rename to buildTemplateCarrierMetered.
This method was introduced recently and has no callers.

This method will be used in Settings and NetworkPolicyManagerService
to display and manage data usage on carrier metered networks.

Settings/NetworkPolicyManagerService will use it instead of the existing
method buildTemplateMobileAll method, which only matches metered networks.
That code will change from matching metered mobile networks to matching
metered carrier networks.

Note: The carrier metered network includes metered mobile network and
metered "merged carrier wifi network" that is a specific cerrier wifi network
which provides the same user experience as mobile.

Bug: 176396812
Test: atest -c NetworkTemplateTest
Change-Id: I7196d62bb60844458a6c4b1d94e2baccb71e15cd
2021-05-14 11:04:17 +08:00
Jayachandran C
b533550b06 QOS filter matching support based on remote address and port number for connected sockets
This CL adds APIs for telephony to perform filter matching based on
remote address if the socket is connected. Additional checks will be
performed on the state of socket to avoid the future callbacks in a
separate CL.

Bug: 181916576
Test: Manually verified in live T-Mobile network
      atest ConnectivityServiceTest
      atest com.android.internal.telephony.dataconnection.QosCallbackTrackerTest

Change-Id: I6fbd4e84c76bc4acbf4e59f06f8e86e0237bae29
2021-05-13 09:50:13 -07:00
Remi NGUYEN VAN
5ed250d90a 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
Merged-In: I254ffd1c08ec058d594b4ea55cbae5505f8497cc

Change-Id: I254ffd1c08ec058d594b4ea55cbae5505f8497cc
2021-05-13 08:30:33 +00:00