Commit Graph

42011 Commits

Author SHA1 Message Date
James Mattis
6b23638b99 [automerger skipped] Merge "Update CS so that per-app OEM APIs can be tested" into sc-dev am: 24ab50b086 -s ours
am skip reason: Merged-In I5a47dcece31749293f080af060218d827082eb67 with SHA-1 fa270db5f7 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14993471

Change-Id: I1183777cab37fadd8a335f66cca13e95fcaca158
2021-06-17 16:27:27 +00:00
James Mattis
24ab50b086 Merge "Update CS so that per-app OEM APIs can be tested" into sc-dev 2021-06-17 16:08:58 +00:00
Junyu Lai
22a9c63234 [automerger skipped] Fix expectCallback does not fail when no callback received am: 52e3fa127a -s ours
am skip reason: Merged-In I627dcd0f57b6ef4197d16e6c1ec0c53e675ab055 with SHA-1 63e3dedfee is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14683929

Change-Id: Ia68e6a38b5120379129d206524202ffe1d7f918e
2021-06-17 10:39:09 +00:00
Junyu Lai
eb50be9103 [automerger skipped] Add CTS for registerBestMatchingNetworkCallback am: 512efafd32 -s ours
am skip reason: Merged-In I81abc1742a3aa965b444d0196f4eaa2393dcad1c with SHA-1 eb5451dd35 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14673220

Change-Id: I50a026db782a305e24694e65d05c0d0d320cdbdc
2021-06-17 10:39:07 +00:00
Junyu Lai
c0b2c8af16 [automerger skipped] No-op refactoring of NetworkAgentTest am: e5bdc06735 -s ours
am skip reason: Merged-In Id7948d218b78ae0abf253ca8925e787362ac463f with SHA-1 32634e9da3 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14662648

Change-Id: If977ed563125b0d9f4afe0757d951c500d2366eb
2021-06-17 10:39:05 +00:00
lifr
231c832781 [automerger skipped] Add CTS test for NetworkAgent/NetworkAgentConfig API am: 42096be0c6 -s ours
am skip reason: Merged-In Ia67b963b8e18af8440b1b9bd91f53439848bb838 with SHA-1 561547a537 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15009311

Change-Id: I91acbe710c9ed4869dae08a31f38722d2766655e
2021-06-17 10:38:51 +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
Junyu Lai
512efafd32 Add CTS for registerBestMatchingNetworkCallback
Bug: 188657173
Test: atest CtsNetTestCases:android.net.cts.NetworkAgentTest \
      CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.NetworkAgentTest \
      CtsNetTestCasesLatestSdk:android.net.cts.ConnectivityManagerTest
      on R device
Merged-In: I81abc1742a3aa965b444d0196f4eaa2393dcad1c
Change-Id: I81abc1742a3aa965b444d0196f4eaa2393dcad1c
  (cherry-picked from aosp/1727824)
2021-06-17 09:02:17 +00:00
Junyu Lai
e5bdc06735 No-op refactoring of NetworkAgentTest
This is a no-op refactoring of NetworkAgentTest, which makes
the create*NetworkAgent helper functions easier to use, this
includes:
  1. Rename "name" field to specifier, since it is the only
     purpose of that field.
  2. Make the callback generated with agent dedicated to the
     agent by adding specifier to support multiple agent cases.
  3. Refactor some code flow to for readability and less
     duplicated code.

Test: atest CtsNetTestCases:android.net.cts.NetworkAgentTest \
      --rerun-until-failure 100
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.NetworkAgentTest
      on R device
Bug: 188657173
Merged-In: Id7948d218b78ae0abf253ca8925e787362ac463f
Change-Id: Id7948d218b78ae0abf253ca8925e787362ac463f
  (cherry-picked from aosp/1727823)
2021-06-17 09:01:09 +00:00
lifr
42096be0c6 Add CTS test for NetworkAgent/NetworkAgentConfig API
The following is a list of APIs:
1. NetworkAgent.setLegacySubtype
2. NetworkAgentConfig.Builder.setLegacySubType
3. NetworkAgentConfig.Builder.setLegacySubTypeName
4. NetworkAgentConfig.Builder.setLegacyExtraInfo

Bug: 190413710
Test: atest android.net.cts.NetworkAgentTest
      atest CtsNetTestCasesLatestSdk:NetworkAgentTest
Merged-In: Ia67b963b8e18af8440b1b9bd91f53439848bb838
Change-Id: Ia67b963b8e18af8440b1b9bd91f53439848bb838
  (cherry-picked from aosp/1693668)
2021-06-17 09:00:30 +00:00
Chiachang Wang
4da66b9d58 Merge "Add test for CM#setAcceptUnvalidated" am: 27586f8210 am: d6d3bf0b89
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1731234

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

Change-Id: Ie49fb789e8731ddac1465fed46f5f139d8ce10f6
2021-06-16 15:39:08 +00: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
Lorenzo Colitti
3f6f84cb43 [automerger skipped] Correctly dump IPv4 downstream flows. am: 175fefc795 -s ours
am skip reason: Merged-In I93a82064c95027c7c63cb30baf8482ecddcbd09d with SHA-1 8569168eda is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14965965

Change-Id: Ibc110544830d364d7489817469bed3b7ed6a55b0
2021-06-16 14:42:21 +00:00
Remi NGUYEN VAN
aec3a5e548 Merge "Make tests compatible with mockito-extended" am: ad7108ce34 am: c3d789bff1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1737400

Change-Id: Ie5b04c5ea05d330dcc97d098720b08d4797927de
2021-06-16 13:56:01 +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
Lorenzo Colitti
175fefc795 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
Original-Change: https://android-review.googlesource.com/1737399
Merged-In: I93a82064c95027c7c63cb30baf8482ecddcbd09d
Change-Id: I93a82064c95027c7c63cb30baf8482ecddcbd09d
2021-06-16 13:25:33 +00:00
Remi NGUYEN VAN
ad7108ce34 Merge "Make tests compatible with mockito-extended" 2021-06-16 13:22:37 +00:00
TreeHugger Robot
e28ff5fe5b [automerger skipped] Merge "Ignore testFactoryReset in instant app mode" into sc-dev am: 75eb9e6ba9 -s ours
am skip reason: Merged-In Icd4a1b2316608ea03a4f7afb32e39400af71950c with SHA-1 8afa20e5d2 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14965964

Change-Id: I3c91648151c19e08127bc6692c6d94e6ab7f3b0c
2021-06-16 13:07:47 +00:00
TreeHugger Robot
75eb9e6ba9 Merge "Ignore testFactoryReset in instant app mode" into sc-dev 2021-06-16 12:56:27 +00:00
Junyu Lai
8aa17e2a6a Merge changes I627dcd0f,I81abc174,Id7948d21 am: 75090fb64e am: 93b8b38683
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1731450

Change-Id: I5588db4e540440e08f62c90d7369fb308a02b2f6
2021-06-16 12:14:22 +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
Lorenzo Colitti
bdde058c66 [automerger skipped] Cleanup commit to remove @SkipPresubmit and fix nits am: 74ded77039 -s ours
am skip reason: Merged-In Idde90ce5e4fc6f56ad617d5ba9735b1bcc2ce8cd with SHA-1 a42e8215d8 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14991452

Change-Id: Ibec8e47c4e7d563ea540731ae4fff6685daf9936
2021-06-16 11:59:03 +00:00
Lorenzo Colitti
f029ca2039 [automerger skipped] Verify kernel implementation of AES-CMAC am: c1a70345b7 -s ours
am skip reason: Merged-In I8b7ee9272722aebdd84ca02475a6107ef61287a9 with SHA-1 1f423e06e2 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14991451

Change-Id: Iea0c8aa1fc786536f2dd5ef65ffbcc6057f062fe
2021-06-16 11:58:56 +00:00
Lorenzo Colitti
f0458218d8 [automerger skipped] Verify kernel implementation of AES-XCBC am: 69b777ccc8 -s ours
am skip reason: Merged-In I57e2bbed2954e4c7de906caae20390f7aebac0e3 with SHA-1 df24620850 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14991432

Change-Id: I5608fc7ea1a0b6696365a36aafb34e0040dc7284
2021-06-16 11:58:47 +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
6f3e90c2e5 Merge "Correctly dump IPv4 downstream flows." am: a8afcd3b0e am: 18e6921d00
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1737399

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

Change-Id: Ifd8c397644f5fc680b34905882ec287bb43c1e1b
2021-06-16 11:37:53 +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
Lorenzo Colitti
2baeaa8d16 [automerger skipped] Verify kernel implementation of AES-CTR am: 816c800df3 -s ours
am skip reason: Merged-In Ib626a6c3999b7d682d0858e92d0dbb5138fdc45d with SHA-1 0c60279648 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14988702

Change-Id: Ie93af16e53168f4c00bf6c21eb9bc02b15fa74ee
2021-06-16 10:44:33 +00:00
Lorenzo Colitti
f9b6e17eed [automerger skipped] Verify kernel implementation of ChaCha20Poly1305 am: 09527d67ca -s ours
am skip reason: Merged-In Ia29540c7fd6848a89bfa2d25c6a87921e45d98da with SHA-1 80be81b302 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14988701

Change-Id: I11d84b5167b36e2a77543ee492ea7fbe7aebddc5
2021-06-16 10:44:31 +00:00
Lorenzo Colitti
677cdea1a4 [automerger skipped] Support algorithm configurability in PacketUtils EspHeader am: 2e65e9fa88 -s ours
am skip reason: Merged-In I53f59815d6cb879dae622fcbd17616564a97111a with SHA-1 00db30f3a0 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14990605

Change-Id: I25d0b5a71654b240cad649f755ce19176328d3a0
2021-06-16 10:44:29 +00:00
Yan Yan
ff18d2e4d1 [automerger skipped] Set up and tear down test network in TestNetworkRunnable am: 144ae3c76a -s ours
am skip reason: Merged-In I0e08a6ea299e6ad94d69806a2d76fa155653b62a with SHA-1 29487b12d5 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14988700

Change-Id: I8e3e012a0cb14012e025ba5d2e0efa416b1d3c1e
2021-06-16 10:44:26 +00: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
Chiachang Wang
766573f4f0 Ignore testFactoryReset in instant app mode
testFactoryReset() will need to check wifi enabled state from
WifiManager. However, test can not get WifiManager in instant
app mode, so ignore the test in instant app mode.

Bug: 190800362
Test: atest android.net.cts.ConnectivityManagerTest\
      #testFactoryReset --instant
Original-Change: https://android-review.googlesource.com/1735673
Merged-In: Icd4a1b2316608ea03a4f7afb32e39400af71950c
Change-Id: Icd4a1b2316608ea03a4f7afb32e39400af71950c
2021-06-16 07:52:59 +00: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
d71d5fd659 Merge "Add a test to check if the VPN type is set or not" am: 3b7c0749d5 am: 1ed1f3fcf8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1733785

Change-Id: Iba0daf89608e68b5e17326b9943f438d3f9ae2c6
2021-06-16 04:22:38 +00: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
James Mattis
b7ca034306 Update CS so that per-app OEM APIs can be tested
Updates to ConnectivityService so that the set OEM network preference
per app APIs can be tested via CTS.

Bug: 176496580
Bug: 176494815
Test: atest FrameworksNetTests
atest FrameworksNetIntegrationTests
atest CtsNetTestCasesLatestSdk

Original-Change: https://android-review.googlesource.com/1723050
Merged-In: I5a47dcece31749293f080af060218d827082eb67
Change-Id: I5a47dcece31749293f080af060218d827082eb67
2021-06-16 03:54:47 +00:00
Chiachang Wang
c17bbec538 Merge "Ignore testFactoryReset in instant app mode" am: f3283e6b93 am: c60aab0243
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1735673

Change-Id: Ibf0f8cf56360ffaa9c94f089018bbfe885373706
2021-06-16 02:35:26 +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
Lorenzo Colitti
74ded77039 Cleanup commit to remove @SkipPresubmit and fix nits
This commit removes @SkipPresubmit annotations in IpSecManagerTest to
re-enable Tcp6 tests in presubmit, since b/186608065 is fixed.

This commit also addresses nits in previous code reviews that include:
- Make EspAuthNull, EspAeadCipher, EspCryptCipher, EspCipherNull
  final classes
- Rename "INSTANCE" to "sInstance", "IPSEC_MANAGER" to "sIpSecManager"
- Rename protected field "iv" to "mIv"
- Use ArraySet instead of HashSet
- Remove unnecessary "public" and "final" in IpSecAlgorithmImplTest

Bug: 171083832
Test: atest IpSecAlgorithmImplTest
Original-Change: https://android-review.googlesource.com/1729418
Merged-In: Idde90ce5e4fc6f56ad617d5ba9735b1bcc2ce8cd
Change-Id: Idde90ce5e4fc6f56ad617d5ba9735b1bcc2ce8cd
2021-06-16 02:08:29 +00:00