Commit Graph

36654 Commits

Author SHA1 Message Date
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
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
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
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
Chiachang Wang
c60aab0243 Merge "Ignore testFactoryReset in instant app mode" am: f3283e6b93
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1735673

Change-Id: I497b71bf3a54c177f1b6e2cd63b3588b3c85f2cb
2021-06-16 02:06:37 +00:00
Chiachang Wang
f3283e6b93 Merge "Ignore testFactoryReset in instant app mode" 2021-06-16 01:49:51 +00:00
Lorenzo Colitti
f9eb2c7b0b Merge changes from topic "per-app-cts" am: 5f78e30839
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1665079

Change-Id: I214f7dd18806d6880b4fe40a6cd5bbe63819f9a0
2021-06-16 01:11:33 +00:00
James Mattis
6c54d5e4c4 Update CS so that per-app OEM APIs can be tested am: fa270db5f7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1723050

Change-Id: Ib5937d0fd732f915416e957299e739fe10d0bf55
2021-06-16 01:11:26 +00:00
Lorenzo Colitti
5f78e30839 Merge changes from topic "per-app-cts"
* changes:
  CTS tests for setOemNetworkPreference
  Update CS so that per-app OEM APIs can be tested
2021-06-16 00:47:06 +00:00
James Mattis
db143f99cf CTS tests for setOemNetworkPreference
CTS tests to validate the setOemNetworkPreference API on
ConnectivityManager. Additionally, a small bit of cleanup for
assumptions around the Wi-Fi feature.

Bug: 176496580
Bug: 176494815
Test: atest CtsNetTestCases:
android.net.cts.ConnectivityManagerTest#
testSetOemNetworkPreferenceForTestPref --iterations
atest CtsNetTestCases:
android.net.cts.ConnectivityManagerTest#
testSetOemNetworkPreferenceForTestOnlyPref --iterations

Change-Id: Ia3e4b336123b60f6df1582aca2979129112afedc
2021-06-15 12:35:18 -07:00
Lorenzo Colitti
ff949864da Merge "Cleanup commit to remove @SkipPresubmit and fix nits" am: 81ede794c7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1729418

Change-Id: I9816ee225b2c647a3127e5a4647722e366c0ddf8
2021-06-15 15:14:30 +00:00
Lorenzo Colitti
61cad6e216 Merge "Verify kernel implementation of AES-CMAC" am: a1363cbd82
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1697312

Change-Id: Iffd5043dc798773405cf10c41c60597c0b8aaaa7
2021-06-15 15:13:18 +00:00
Lorenzo Colitti
81ede794c7 Merge "Cleanup commit to remove @SkipPresubmit and fix nits" 2021-06-15 14:54:07 +00:00
Lorenzo Colitti
a1363cbd82 Merge "Verify kernel implementation of AES-CMAC" 2021-06-15 14:53:36 +00:00
Lorenzo Colitti
8569168eda Correctly dump IPv4 downstream flows.
The current code does not print these correctly: it prints the
public address twice and then the NAT address. Fix this to print
the src, nat, and dst addresses.

Also dump the output MAC address.

Example output:

    IPv4 Upstream: [inDstMac] iif(iface) src -> nat -> dst [outDstMac] age
      [66:f1:6f:d8:66:0a] 31(31) 192.168.146.173:48594 -> 11(rmnet_data1) 100.100.109.185:48594 -> 8.8.8.8:853 [00:00:00:00:00:00] 32305ms
      [66:f1:6f:d8:66:0a] 31(31) 192.168.146.173:45806 -> 11(rmnet_data1) 100.100.109.185:45806 -> 8.8.4.4:853 [00:00:00:00:00:00] 32305ms
    IPv4 Downstream: [inDstMac] iif(iface) src -> nat -> dst [outDstMac] age
      [00:00:00:00:00:00] 11(rmnet_data1) 8.8.8.8:853 -> 31(31) 100.100.109.185:48594 -> 192.168.146.173:48594 [0e:a8:7f:ba:76:48] 32305ms
      [00:00:00:00:00:00] 11(rmnet_data1) 8.8.4.4:853 -> 31(31) 100.100.109.185:45806 -> 192.168.146.173:45806 [0e:a8:7f:ba:76:48] 32305ms

Test: manual
Bug: 190783768
Change-Id: I93a82064c95027c7c63cb30baf8482ecddcbd09d
2021-06-15 23:11:27 +09:00
Lorenzo Colitti
ec110e2e24 Merge "Don't run testGetAllNetworkStateSnapshots in instant app mode" am: b91372a50f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1737396

Change-Id: I9807baa0089b208c6831c73b86cfcee8026f1d6b
2021-06-15 13:38:58 +00:00
Lorenzo Colitti
b91372a50f Merge "Don't run testGetAllNetworkStateSnapshots in instant app mode" 2021-06-15 13:29:19 +00:00
Anton Hansson
11b6b499aa Merge "Add tethering bootclasspath fragment to its sdk" am: ee350966fa
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1737041

Change-Id: Iceb19109282c105b707f22004d1b4181695860b9
2021-06-15 13:26:23 +00:00
Anton Hansson
ee350966fa Merge "Add tethering bootclasspath fragment to its sdk" 2021-06-15 13:11:44 +00:00
Lucas Lin
f7aa7c51ee Merge "Send a proxy broadcast when apps moved from/to a VPN" am: cfc86ef0f6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1717735

Change-Id: I2fc18571e6ecf36d919d9c5971c275f5c26ddfa4
2021-06-15 09:28:16 +00:00