Commit Graph

29032 Commits

Author SHA1 Message Date
Frank Li
93c4f4cc2d Merge "Add CTS test for NetworkRequest.getCapabilities API" into sc-dev am: 799d1c6053
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15013235

Change-Id: I8aa95782a699b6b711441e47adb7056a449986a3
2021-06-18 01:57:57 +00:00
Frank Li
ab46d66d0d Merge "Add test for ConnectivityService API isPrivateDnsBroken" into sc-dev am: 9097aaf5db
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15013234

Change-Id: Ia41376d391cdfa3444b4a46ae003d315bbfc45f9
2021-06-18 01:57:43 +00:00
Frank Li
ee4006fa06 Merge "Add CTS test for API setLegacyExtraInfo" into sc-dev am: a9602dc5d3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15013233

Change-Id: I39ebd7e74d548971af7e6581ce77f32b9be82208
2021-06-18 01:57:18 +00:00
Frank Li
799d1c6053 Merge "Add CTS test for NetworkRequest.getCapabilities API" into sc-dev 2021-06-18 01:37:20 +00:00
Frank Li
9097aaf5db Merge "Add test for ConnectivityService API isPrivateDnsBroken" into sc-dev 2021-06-18 01:37:08 +00:00
Frank Li
a9602dc5d3 Merge "Add CTS test for API setLegacyExtraInfo" into sc-dev 2021-06-18 01:36:44 +00:00
James Mattis
a4e465da0b Merge "Update CS so that per-app OEM APIs can be tested" into sc-dev am: 24ab50b086
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14993471

Change-Id: I0f8b1a947ca6e738bc21ee2c49e2412b2f99997d
2021-06-17 16:28:42 +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
Frank Li
f8e2e20f32 Add CTS test for NetworkRequest.getCapabilities API
Bug: 189162033
Test: atest android.net.cts.NetworkRequestTest
      atest CtsNetTestCasesLatestSdk:NetworkRequestTest
Original-Change: https://android-review.googlesource.com/1717737
Merged-In: I8504caa586bdb567d42047a96029dedc67968793
Change-Id: I8504caa586bdb567d42047a96029dedc67968793
2021-06-17 13:42:34 +00:00
Frank Li
3a48843e49 Add test for ConnectivityService API isPrivateDnsBroken
Bug: 189161363
Test: atest android.net.cts.ConnectivityManagerTest
      atest CtsNetTestCasesLatestSdk:ConnectivityManagerTest
Original-Change: https://android-review.googlesource.com/1719395
Merged-In: Ib45aa439683d48360652a91d7a0609dc82adda33
Change-Id: Ib45aa439683d48360652a91d7a0609dc82adda33
2021-06-17 13:22:39 +00:00
Frank Li
b7eebde98a Add CTS test for API setLegacyExtraInfo
Adding in-depth test in NetworkAgentTest
Bug: 187040803
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkAgentConfigTest
      atest CtsNetTestCases:android.net.NetworkAgentConfigTest
Original-Change: https://android-review.googlesource.com/1719131
Merged-In: Ief14f6de0cb6913da944414f0b134eb04346425f
Change-Id: Ief14f6de0cb6913da944414f0b134eb04346425f
2021-06-17 13:00:57 +00:00
Junyu Lai
00b03beb31 Fix expectCallback does not fail when no callback received am: 52e3fa127a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14683929

Change-Id: Icd7743a03627382bf797b859b48b02bbee635b1f
2021-06-17 10:40:09 +00:00
Junyu Lai
d576a4d0a9 Add CTS for registerBestMatchingNetworkCallback am: 512efafd32
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14673220

Change-Id: I975a03a391d09787975a9572aa097b47709f817e
2021-06-17 10:40:07 +00:00
Junyu Lai
1fefd7f674 No-op refactoring of NetworkAgentTest am: e5bdc06735
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14662648

Change-Id: Id039d9285e4c7aefd59a75be68ff5a2f039e260c
2021-06-17 10:40:05 +00:00
lifr
396c9afb65 Add CTS test for NetworkAgent/NetworkAgentConfig API am: 42096be0c6
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15009311

Change-Id: I15d0567cae9f26c276377a60c73732d91264f818
2021-06-17 10:39:43 +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
Lorenzo Colitti
6009cf9746 Correctly dump IPv4 downstream flows. am: 175fefc795
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14965965

Change-Id: Id7033bb1863e7f4930c3e3da63641fadfb0c3ef2
2021-06-16 14:43:06 +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
TreeHugger Robot
65e4008df2 Merge "Ignore testFactoryReset in instant app mode" into sc-dev am: 75eb9e6ba9
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14965964

Change-Id: Ic8dd87cdd344d5ac88d195faf1d510679f5c30c7
2021-06-16 13:08:50 +00:00
TreeHugger Robot
75eb9e6ba9 Merge "Ignore testFactoryReset in instant app mode" into sc-dev 2021-06-16 12:56:27 +00:00
Lorenzo Colitti
e276a5c2e0 Cleanup commit to remove @SkipPresubmit and fix nits am: 74ded77039
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14991452

Change-Id: I342d1bbdd1f2a654a98d454f71a5e5e9654dba95
2021-06-16 12:00:03 +00:00
Lorenzo Colitti
7a1c1fee31 Verify kernel implementation of AES-CMAC am: c1a70345b7
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14991451

Change-Id: If2f59885fb8f8189138fa61e6d640bd19c8cb615
2021-06-16 11:59:54 +00:00
Lorenzo Colitti
816ff6966b Verify kernel implementation of AES-XCBC am: 69b777ccc8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14991432

Change-Id: I9d82303cd0b558e0c41f5f2fc1222ffa707ea6e9
2021-06-16 11:59:42 +00:00
Lorenzo Colitti
41d5080646 Verify kernel implementation of AES-CTR am: 816c800df3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14988702

Change-Id: I216c6ebe834839f8be089cf469a19045293452c2
2021-06-16 10:45:45 +00:00
Lorenzo Colitti
4d97e41293 Verify kernel implementation of ChaCha20Poly1305 am: 09527d67ca
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14988701

Change-Id: I096ae20fda86a2cc593b516079fd072183ba672e
2021-06-16 10:45:43 +00:00
Lorenzo Colitti
5935f1ea81 Support algorithm configurability in PacketUtils EspHeader am: 2e65e9fa88
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14990605

Change-Id: I40c2a64de05388918d35748ad99591f73000ca79
2021-06-16 10:45:41 +00:00
Yan Yan
b44d08eece Set up and tear down test network in TestNetworkRunnable am: 144ae3c76a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14988700

Change-Id: I57411f845503f0f7d1bdc2800d16208ba6b46f2e
2021-06-16 10:45:39 +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
Lorenzo Colitti
3288cb52bc Correctly get uids for per-app network preferences am: 659a0e145f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14986139

Change-Id: I713bcdc3d0008074f8603263e415097322b26f4c
2021-06-16 04:07:10 +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
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
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
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
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
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
Lorenzo Colitti
e5f9800e0b Don't run testGetAllNetworkStateSnapshots in instant app mode am: 1ee5ba31a6
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14935371

Change-Id: I78224ae28eba3a4822d584c49d29085275f6cd77
2021-06-15 16:37:30 +00: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
Lorenzo Colitti
0bb712f93c Merge changes I3fffbf4a,If557b0a1 into sc-dev am: bba6383a73
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14963613

Change-Id: Iefc6f6ead2b61e2c36dea1c2a9077990b1d4980b
2021-06-15 11:28:07 +00:00
Treehugger Robot
b92c99534a Dump underlying BPF traffic stats as well as higher-level stats. am: 898d5adb31
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14963612

Change-Id: Idbc82073afde61e7f3706b7d975063a9fa1b25fd
2021-06-15 11:28:05 +00:00
Lorenzo Colitti
bba6383a73 Merge changes I3fffbf4a,If557b0a1 into sc-dev
* changes:
  Improve dumping IPv4 map entries.
  Dump underlying BPF traffic stats as well as higher-level stats.
2021-06-15 10:24:41 +00:00
TreeHugger Robot
8448b67a15 Merge "Add unit test when querying TYPE_WIFI + null/empty/non-null subscriberId" into sc-dev am: 97e90536a8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14963611

Change-Id: I1e444f94cff2cb0ce4041224a70b00997e24cdd4
2021-06-15 09:33:18 +00:00
TreeHugger Robot
97e90536a8 Merge "Add unit test when querying TYPE_WIFI + null/empty/non-null subscriberId" into sc-dev 2021-06-15 09:16:57 +00:00
Nucca Chen
4425a6147c Improve dumping IPv4 map entries.
1. Dump both upstream and downstream rules.
2. Also dump rule last used time.

Test: manual
Bug: 190783768
Original-Change: https://android-review.googlesource.com/1737394
Merged-In: I3fffbf4a5dea68e61349de8b41bea49b8a319f86
Change-Id: I3fffbf4a5dea68e61349de8b41bea49b8a319f86
2021-06-15 08:20:31 +00:00
Treehugger Robot
898d5adb31 Dump underlying BPF traffic stats as well as higher-level stats.
This provides a better way to tell whether traffic is flowing.

Test: manual
Bug: 190783768
Original-Change: https://android-review.googlesource.com/1737393
Merged-In: If557b0a18fc0aea1bf6a65d91547fc1930098ed0
Change-Id: If557b0a18fc0aea1bf6a65d91547fc1930098ed0
2021-06-15 08:19:51 +00:00