Commit Graph

36671 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
307cb41ade Merge "Add tests for duplicate PendingIntent requests" 2021-06-22 23:35:42 +00:00
Junyu Lai
69bc4fede1 Merge "[SP32] Try to get 1.1 OffloadControl hardware if available" 2021-06-22 20:31:18 +00:00
Yan Yan
010ec2cddd Merge "Test updating underlying network of IpSecTunnelInterface" 2021-06-22 17:27:11 +00:00
Remi NGUYEN VAN
489275e84e Add tests for duplicate PendingIntent requests
Add tests for requestNetwork and registerNetworkCallback with
PendingIntents that are equal as per PendingIntent.intentFilterEquals.

In such situations, the first request is documented to be automatically
unregistered. This means that the PendingIntent should only be fired
once, instead of being fired for both requests.

Currently this behavior is broken for network callbacks (not for network
requests).

Test: atest ConnectivityManagerTest
Bug: 174237997
Change-Id: Ic636c731c71474ef09043d7a26ccfd6e2bb5c39f
2021-06-22 18:24:52 +09:00
Paul Hu
5440e0b8e8 Merge "Add test for CSM#[get|set]MobileDataPreferredUids" 2021-06-22 01:33:49 +00:00
Lucas Lin
3f565a44b0 Merge "Add CTS for isUidNetworkingBlocked & isUidRestrictedOnMeteredNetworks" 2021-06-21 23:58:49 +00:00
Lucas Lin
56055496f3 Merge "Use assertEquals instead of assertTrue to compare the vpn type" 2021-06-21 23:35:16 +00:00
Lucas Lin
7e2a491835 Merge "Add CTS for systemReady() & getIpSecNetIdRange()" 2021-06-21 20:52:46 +00:00
Lucas Lin
c12550b9f4 Merge "Call ConnectivitySettingsUtils to set/get private DNS related settings" 2021-06-21 19:12:33 +00:00
James Mattis
420072651d Merge "Updating timeout for Per-App CTS" 2021-06-21 17:17:13 +00:00
lucaslin
b781a94ccf Add CTS for systemReady() & getIpSecNetIdRange()
Bug: 182963354
Test: 1. atest CtsNetTestCases:ConnectivityManagerTest
      2. atest CtsNetTestCasesLatestSdk:ConnectivityManagerTest
Change-Id: I0b286f32389501402e552010546c62f3e56833d6
2021-06-21 19:37:43 +08:00
Treehugger Robot
aa397809e2 Merge "Add a test for ConnectivityFrameworkInitializer" 2021-06-21 11:23:11 +00:00
Treehugger Robot
bccd97f0b3 Merge "Add test for setHttpProxyConfiguration" 2021-06-21 10:59:12 +00:00
Junyu Lai
f92979bd5b Merge "Add CTS for registerNetworkOffer" 2021-06-21 10:58:04 +00:00
Mark Chien
cec294d1b4 Merge changes I270ff43c,Ifc7eee24
* changes:
  Add enable and disable ip serving common functions
  Allow to use ncm function for usb tethering
2021-06-21 10:56:45 +00:00
Remi NGUYEN VAN
cc79d7c0f8 Merge "Add connectivity coverage tests" 2021-06-21 10:55:33 +00:00
Treehugger Robot
5d4f701244 Merge "Add CTS for setProfileNetworkPreference" 2021-06-21 10:25:05 +00:00
Remi NGUYEN VAN
ec48bb82aa Merge "Allow mocking permission in TetheringServiceTest" 2021-06-21 10:19:07 +00:00
Remi NGUYEN VAN
7c5902df7e Merge "Initialize TetheringManager lazily" 2021-06-21 10:03:00 +00:00
Aaron Huang
b93396edfb Merge "CTS test for PacProxyManager" 2021-06-21 09:42:33 +00:00
lucaslin
8962128a0b Call ConnectivitySettingsUtils to set/get private DNS related settings
ConnectivitySettingsManager and CtsNetUtils are doing the same
thing to set/get private DNS related settings.
To prevent making the duplication code in two places, move the
body to frameworks/libs/net and call it.

Bug: 185311744
Test: atest CtsNetTestCases CtsNetTestCasesLatestSdk
Change-Id: I3272c825b86ec30c3d0bf4097088c653e668461b
2021-06-21 16:39:08 +08:00
paulhu
8c96badb5d Add test for CSM#[get|set]MobileDataPreferredUids
Bug: 171872461
Test: atest ConnectivityManagerTest
Change-Id: I43dfb049c271602526fa3e89ebb91219c7785a21
2021-06-21 08:36:04 +00:00
Remi NGUYEN VAN
e4d1cd970e Initialize TetheringManager lazily
Many applications use ConnectivityManager without needing
TetheringManager (or without calling legacy ConnectivityManager methods
that delegate to TetheringManager), so initializing TetheringManager
when ConnectivityManager is created wastes resources.

This is especially true considering that TetheringManager is not trivial
to initialize (worst case scenario it starts a thread and does multiple
Binder requests), and ConnectivityManager is created in ActivityThread
when setting up the app proxy on startup.

Bug: 190556328
Test: atest FrameworksNetTests CtsNetTestCases TetheringTests
Change-Id: I2ba7b8f2b9e1c934cfb082776b8d643f2f2c17e5
2021-06-21 10:59:14 +09:00
lucaslin
0639afa9ca Add CTS for isUidNetworkingBlocked & isUidRestrictedOnMeteredNetworks
BYPASS_INCLUSIVE_LANGUAGE_REASON=To make the change more clear,
fix the inclusive problem in a follow-up commit.
Bug: 176289731
Test: atest CtsHostsideNetworkTests:HostsideNetworkPolicyManagerTests
Change-Id: Ie6bda8570979b10a28dbeb20f6db7a9c44735964
2021-06-20 07:43:06 +00:00
Xin Li
e7fde0c39a DO NOT MERGE - Merge RQ3A.210605.005
Bug: 190855093
Merged-In: I524644366a398b34de8f659d0d0d275f3f513c0c
Change-Id: I19bfd3cbd9f65d7936d9cbcbd840c96009f3a575
2021-06-18 12:24:45 -07:00
markchien
76e2e1c702 Add enable and disable ip serving common functions
This is a op CL which prepare for refactor.

Bug: 185649441
Bug: 189410000
Bug: 178116595

Test: atest TetheringTests
Change-Id: I270ff43c01736b9d18bd40a8e88e1379e9e4e863
2021-06-18 21:35:40 +08:00
markchien
cab01b7ebc Allow to use ncm function for usb tethering
Adding the configuration to decide using rndis or ncm for usb tethering.
If ncm is configured for TETHEIRNG_USB, then TETHERING_NCM is not
available.

Bug: 162920185
Test: atest TetheringTests
      manul testing usb tethering
Change-Id: Ifc7eee2457a950a0e2d1c3cc89a3373a7ad23c9c
2021-06-18 11:20:26 +08:00
Yan Yan
76aa81debf Test updating underlying network of IpSecTunnelInterface
This CL adds tests to verify that after setting
IpSecTunnelInterface to use a different undelying network and
re-applying IpSecTransforms with matching addresses, traffic
can be routed to/from the new underlying network.

All these new tests will be skipped if SDK < S

Bug: 169855650
Test: atest IpSecManagerTunnelTest (new tests added)
Change-Id: Iab26159e5e070574e552d62e4f0780059a51a9c7
2021-06-17 18:16:30 -07:00
lucaslin
56bc7d4dde Use assertEquals instead of assertTrue to compare the vpn type
Bug: 184261389
Test: atest CtsHostsideNetworkTests:HostsideVpnTests#testDefault
Change-Id: I55371fabe0d2fa32a71520af11f18f1eeea31460
2021-06-17 19:43:08 +08:00
James Mattis
4dad9710e1 Updating timeout for Per-App CTS
Increasing the timeout values for waiting for callbacks for the per-app
CTS tests to match the timeout value used in the waitForAvailable()
helper method.

Bug: 191230288
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Change-Id: I49e5a99f18a5651370e6914f30be659134b537ff
2021-06-16 19:11:45 -07:00
Chiachang Wang
d6d3bf0b89 Merge "Add test for CM#setAcceptUnvalidated" am: 27586f8210
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1731234

Change-Id: I524644366a398b34de8f659d0d0d275f3f513c0c
2021-06-16 15:29:47 +00:00
Chiachang Wang
98e8422124 Merge "Add test for CM#setAcceptPartialConnectivity" am: 2693dc2696
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1730545

Change-Id: I702a17935b7e0a29d5c45e5ae6bd7ccf3c76eccd
2021-06-16 15:29:37 +00:00
Chiachang Wang
27586f8210 Merge "Add test for CM#setAcceptUnvalidated" 2021-06-16 15:17:51 +00:00
Chiachang Wang
2693dc2696 Merge "Add test for CM#setAcceptPartialConnectivity" 2021-06-16 15:17:37 +00:00
Remi NGUYEN VAN
c3d789bff1 Merge "Make tests compatible with mockito-extended" am: ad7108ce34
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1737400

Change-Id: I3c6de9b5da64e3bb26b1dc75e9184cf373d313fe
2021-06-16 13:34:34 +00:00
Remi NGUYEN VAN
ad7108ce34 Merge "Make tests compatible with mockito-extended" 2021-06-16 13:22:37 +00:00
Chiachang Wang
901eeb201d Add test for CM#setAcceptUnvalidated
The always bit is verified in NetworkAgentTest. There is no easy
configuration to set an explicitly selected network to accept an
unvalidated network. Verify the accepted case also in
NetworkAgentTest.

Bug: 186061922
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Test: atest CtsNetTestCasesLatestSdk
Change-Id: I803eb975fb0b6c52d55b2310293bcad407d21f42
2021-06-16 20:09:08 +08:00
Chiachang Wang
589105d385 Add test for CM#setAcceptPartialConnectivity
Bug: 186061922
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Test: atest CtsNetTestCasesLatestSdk
Change-Id: Iba312defb6f02896eac518d71d36f1ef3df3d00b
2021-06-16 20:06:15 +08:00
Junyu Lai
93b8b38683 Merge changes I627dcd0f,I81abc174,Id7948d21 am: 75090fb64e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1731450

Change-Id: I3662e70034b16721e4ad1711654cb9f7eda45d35
2021-06-16 11:59:37 +00:00
Junyu Lai
75090fb64e Merge changes I627dcd0f,I81abc174,Id7948d21
* changes:
  Fix expectCallback does not fail when no callback received
  Add CTS for registerBestMatchingNetworkCallback
  No-op refactoring of NetworkAgentTest
2021-06-16 11:46:34 +00:00
Lorenzo Colitti
18e6921d00 Merge "Correctly dump IPv4 downstream flows." am: a8afcd3b0e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1737399

Change-Id: Ide15a934f8df06800815d61738d2ee3ac0741264
2021-06-16 11:25:02 +00:00
Remi NGUYEN VAN
96ad425c5e Merge "Remove ConnectivityServiceTest signature perms use" am: 54c7434f0d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1736615

Change-Id: I0f9c3677f135dd48fc73da08661497190f8d3c20
2021-06-16 11:24:51 +00:00
Lorenzo Colitti
a8afcd3b0e Merge "Correctly dump IPv4 downstream flows." 2021-06-16 11:15:30 +00:00
Remi NGUYEN VAN
54c7434f0d Merge "Remove ConnectivityServiceTest signature perms use" 2021-06-16 11:09:05 +00:00
Remi NGUYEN VAN
fe20e1317d Add connectivity coverage tests
The coverage tests will allow measuring code coverage for all
Connectivity+Tethering code.

This is a combination of the current TetheringCoverageTests, and
FrameworksNetTests.

Adding min_sdk_version to the test prevents it from using deprecated
IoUtils utilities. Replace it with the non-deprecated alternative.

Test: atest ConnectivityCoverageTests
Change-Id: I5366e1cc9cd6ddb41f24718246381cc2b1cc1383
2021-06-16 19:45:20 +09:00
Remi NGUYEN VAN
0ae7e5bdcd Allow mocking permission in TetheringServiceTest
The test will currently fail if it is run in a package that has
ACCESS_NETWORK_STATE. Add utilities to mock permissions, and mock the
ACCESS_NETWORK_STATE permission to be denied.

Bug: 187935317
Test: atest TetheringServiceTest
Change-Id: I8df5f2ac21bf0314098e8c2e5ba583676ae8ab38
2021-06-16 17:53:10 +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
18a979fa41 Remove ConnectivityServiceTest signature perms use
To allow unit tests to run without platform certificates, remove
signature permission usage in ConnectivityServiceTest.

This mocks permission checks done in ConnectivityService for which the
test assumed that the permission was held, and mocks calls to
BatteryStatsManager. Calls to ActivityManagerService (through
PendingIntent) are done with shell permissions as the test uses real
PendingIntent mechanics.

Bug: 187935317
Test: atest FrameworksNetTests
Change-Id: If309d653ac2e9bbcf1b94bcee6336367289df359
2021-06-16 16:32:03 +09:00
Lucas Lin
1ed1f3fcf8 Merge "Add a test to check if the VPN type is set or not" am: 3b7c0749d5
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1733785

Change-Id: I33a31c80f5cf30f329fc168f0b7cc291add0d7e9
2021-06-16 04:00:13 +00:00
Lucas Lin
3b7c0749d5 Merge "Add a test to check if the VPN type is set or not" 2021-06-16 02:22:45 +00:00