Commit Graph

41986 Commits

Author SHA1 Message Date
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
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
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
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
Lorenzo Colitti
c1a70345b7 Verify kernel implementation of AES-CMAC
This CL adds a test to verify kernel implementation of AES-CMAC

Since there is no hardware that first launched with SDK beyond R
at the time of writing this CL, the test for AES-CMAC was manually
enabled and verified on redfin (redfin kernel already supports
AES-CMAC)

Bug: 171083832
Test: atest IpSecAlgorithmImplTest
Original-Change: https://android-review.googlesource.com/1697312
Merged-In: I8b7ee9272722aebdd84ca02475a6107ef61287a9
Change-Id: I8b7ee9272722aebdd84ca02475a6107ef61287a9
2021-06-16 02:07:50 +00:00
Lorenzo Colitti
69b777ccc8 Verify kernel implementation of AES-XCBC
This CL adds a test to verify kernel implementation of AES-XCBC.

Since there is no hardware that first launched with SDK beyond R
at the time of writing this CL, the test for AES-XCBC was manually
enabled and verified on coral (coral-kernel already supports
AES-XCBC)

Bug: 171083832
Test: atest IpSecAlgorithmImplTest
Original-Change: https://android-review.googlesource.com/1503696
Merged-In: I57e2bbed2954e4c7de906caae20390f7aebac0e3
Change-Id: I57e2bbed2954e4c7de906caae20390f7aebac0e3
2021-06-16 02:06:59 +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
Lorenzo Colitti
816c800df3 Verify kernel implementation of AES-CTR
This CL adds a test to verify kernel implementation of AES-CTR

Since there is no hardware that first launched with SDK beyond R
at the time of writing this CL, new tests for AES-CTR were manually
enabled and verified on coral (coral-kernel already supports
AES-CTR)

Bug: 171083832
Test: atest IpSecAlgorithmImplTest
Original-Change: https://android-review.googlesource.com/1503695
Merged-In: Ib626a6c3999b7d682d0858e92d0dbb5138fdc45d
Change-Id: Ib626a6c3999b7d682d0858e92d0dbb5138fdc45d
2021-06-16 02:06:11 +00:00
Lorenzo Colitti
09527d67ca Verify kernel implementation of ChaCha20Poly1305
This CL adds the test infra for testing kernel implementation of IPsec
algorithms and a test for ChaCha20Poly1305

Since there is no hardware that first launched with SDK beyond R at the
time of writing this CL, the test for ChaChaPoly was manually
enabled and verified on the pixel with an updated kernel

Bug: 171083832
Test: atest IpSecAlgorithmImplTest
Original-Change: https://android-review.googlesource.com/1503694
Merged-In: Ia29540c7fd6848a89bfa2d25c6a87921e45d98da
Change-Id: Ia29540c7fd6848a89bfa2d25c6a87921e45d98da
2021-06-16 02:05:07 +00:00
Lorenzo Colitti
067050a1a4 [automerger skipped] Correctly get uids for per-app network preferences am: 659a0e145f -s ours
am skip reason: Merged-In I7d75cdb02041e7a202254be2eaeca6c2b02d7c29 with SHA-1 b6b6a4335a is already in history

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

Change-Id: Iaee7562764d7d82813e9978bbed5b0382b663e48
2021-06-16 02:01:07 +00:00
Lorenzo Colitti
2e65e9fa88 Support algorithm configurability in PacketUtils EspHeader
This CL adds support to configure the IPsec algortihms to build
EspHeader.

This is a prepration CL to test kernel implementation of IPsec
algorithms.

Bug: 171083832
Test: atest CtsNetTestCases
Original-Change: https://android-review.googlesource.com/1503693
Merged-In: I53f59815d6cb879dae622fcbd17616564a97111a
Change-Id: I53f59815d6cb879dae622fcbd17616564a97111a
2021-06-16 01:58:27 +00:00
Chiachang Wang
f3283e6b93 Merge "Ignore testFactoryReset in instant app mode" 2021-06-16 01:49:51 +00:00
Yan Yan
144ae3c76a Set up and tear down test network in TestNetworkRunnable
Allow test caller to construct a TestNetworkRunnable to run a
test with a test network.

This is a preparation for adding tests to verify kernel
implementation of IPsec algorithms.

Bug: 171083832
Test: atest Ikev2VpnTest
Original-Change: https://android-review.googlesource.com/1503692
Merged-In: I0e08a6ea299e6ad94d69806a2d76fa155653b62a
Change-Id: I0e08a6ea299e6ad94d69806a2d76fa155653b62a
2021-06-16 01:48:51 +00:00
Lorenzo Colitti
64132f489a Merge changes from topic "per-app-cts" am: 5f78e30839 am: f9eb2c7b0b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1665079

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

Change-Id: I5f8bc3a60d92e86047debd9363e5dddf06da6ee8
2021-06-16 01:30:05 +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
Lorenzo Colitti
659a0e145f Correctly get uids for per-app network preferences
Per-app network functionality assumed all apps were installed for user 0
which is not always the case. This fix will address that by checking for
the existance of an app for all users and adding it to the per-app
network preference as was originally intended. Prior, no apps were
included if they were not installed for user 0 even if they were
available for another user such as user 10 in automotive.

Bug: 189838408
Test: atest FrameworksNetTests
atest FrameworksNetIntegrationTests
atest CtsNetTestCases

Original-Change: https://android-review.googlesource.com/1723617
Merged-In: I7d75cdb02041e7a202254be2eaeca6c2b02d7c29
Change-Id: I7d75cdb02041e7a202254be2eaeca6c2b02d7c29
2021-06-15 21:56:13 +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
ee260679f7 [automerger skipped] Don't run testGetAllNetworkStateSnapshots in instant app mode am: 1ee5ba31a6 -s ours
am skip reason: Merged-In I2897462f4ef6c019b80a3b5159b1c41f397af8de with SHA-1 3d35a9736f is already in history

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

Change-Id: Idbaf8e6312545783e3fbabbfd0796ed21b3ec7a9
2021-06-15 16:36:33 +00:00
Lorenzo Colitti
4584e16096 Merge "Cleanup commit to remove @SkipPresubmit and fix nits" am: 81ede794c7 am: ff949864da
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1729418

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

Change-Id: I2a56508a3b863a6544df35d9fd17ecd2cda8869c
2021-06-15 15:30:52 +00: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
1ee5ba31a6 Don't run testGetAllNetworkStateSnapshots in instant app mode
Instant app mode doesn't have permission to request networks.
Thus, ignore the test in instant app mode.

Bug: 189724761
Test: CtsNetTestCases:ConnectivityManagerTest#testGetAllNetworkStateSnapshots \
      --instant
Original-Change: https://android-review.googlesource.com/1737396
Merged-In: I2897462f4ef6c019b80a3b5159b1c41f397af8de
Change-Id: I2897462f4ef6c019b80a3b5159b1c41f397af8de
2021-06-15 14:06:26 +00:00