Commit Graph

2416 Commits

Author SHA1 Message Date
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
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
f3283e6b93 Merge "Ignore testFactoryReset in instant app mode" 2021-06-16 01:49:51 +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
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
b91372a50f Merge "Don't run testGetAllNetworkStateSnapshots in instant app mode" 2021-06-15 13:29:19 +00:00
Lucas Lin
cfc86ef0f6 Merge "Send a proxy broadcast when apps moved from/to a VPN" 2021-06-15 09:26:21 +00:00
Lorenzo Colitti
ea56397997 Merge "Verify kernel implementation of AES-XCBC" 2021-06-15 09:12:35 +00:00
Lorenzo Colitti
b8aeaa220c Merge "Verify kernel implementation of AES-CTR" 2021-06-15 09:09:05 +00:00
Remi NGUYEN VAN
efdffa82f8 Merge "Fix KeepalivePacketDataUtilTest crash on eng build" 2021-06-15 07:08:23 +00:00
Treehugger Robot
1dba7454b3 Merge "Add unit test when querying TYPE_WIFI + null/empty/non-null subscriberId" 2021-06-15 06:46:49 +00:00
Aaron Huang
3d35a9736f 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
Change-Id: I2897462f4ef6c019b80a3b5159b1c41f397af8de
2021-06-15 14:17:07 +08:00
Lorenzo Colitti
69c14d531c Merge "Verify kernel implementation of ChaCha20Poly1305" 2021-06-15 05:18:24 +00:00
Lorenzo Colitti
ec5d07c59e Merge "Support algorithm configurability in PacketUtils EspHeader" 2021-06-15 05:17:51 +00:00
Les Lee
a0592d3e06 Add unit test when querying TYPE_WIFI + null/empty/non-null subscriberId
Starting with API level 31, the subscriberId is applicable
for the wifi network. Considering applications may use
null or an empty string as subscriberId (for instance, cts),
frameworks create MATCH_WIFI_WILDCARD NetworkTemplate when querying
wifi network with null or an empty string which is the behavior before
API level 31.

Bug: 188915450
Test: atest -c NetworkStatsManagerTest
Change-Id: Id4ae06840e1749997e970b8f1ec391060967bd47
2021-06-15 12:04:23 +08:00
Paul Hu
c323f6502d Merge "Add DEFAULT_NETWORK_PRIORITY constants" 2021-06-15 02:42:03 +00:00
Paul Hu
c6741064d0 Merge "Add more unit tests for mobile data preferred uids feature" 2021-06-15 01:28:19 +00:00
Yan Yan
1e071f9120 Merge "Set up and tear down test network in TestNetworkRunnable" 2021-06-15 00:36:12 +00:00
Sudheer Shanka
7184887d71 Merge "Avoid waiting unnecessarily if there is no data to return." 2021-06-14 18:39:30 +00:00
paulhu
e99137226e Add DEFAULT_NETWORK_PRIORITY constants
- Add default network priority to NetworkRequestInfo.
- The default network priority value is used when issue uid
  ranges rules to netd. Netd will use the priority value and uid
  ranges to generate corresponding ip rules specific to the given
  network preference.

Bug: 171872461
Test: atest FrameworksNetTests
Merged-In: I0ea71b348492aeb4784d487bed4cfd5d387426ba

Change-Id: I0ea71b348492aeb4784d487bed4cfd5d387426ba
2021-06-14 15:55:55 +00:00
paulhu
01f52e7cce Add more unit tests for mobile data preferred uids feature
- Add more tests for mobile data preferred uids.
- Also address leftover comments on implementation commit.

Bug: 171872461
Test: atest FrameworksNetTests
Merged-In: I63f65bffc1b8883ddfd774222e26e629d7ea1f94

Change-Id: I63f65bffc1b8883ddfd774222e26e629d7ea1f94
2021-06-14 15:53:05 +00:00
Remi NGUYEN VAN
b397b5645a Fix KeepalivePacketDataUtilTest crash on eng build
The test causes a Log.wtf to be logged, because it tests a method that
should not be used after R. Mock the terrible failure handler to avoid
crashes on eng builds.

Test: atest KeepalivePacketDataUtilTest

Change-Id: Ic06a0db7fefb4acf38b66feba9b47e21f9927b1c
2021-06-14 18:13:39 +09:00
Lorenzo Colitti
473ddeaebb Merge "Correctly get uids for per-app network preferences" 2021-06-14 06:07:56 +00:00
Sudheer Shanka
f3d8c6f70e Avoid waiting unnecessarily if there is no data to return.
Bug: 189790442
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: I091991aac8eb11319bd60dc8f07124ace1ad52f1
2021-06-14 03:13:41 +00:00
Luke Huang
c9a2bdf2b9 Merge "Modify NsdServiceTest to conform to its new mechanism" 2021-06-13 15:20:52 +00:00
Frank Li
67fe28455d Merge "Add test for ConnectivityService API isPrivateDnsBroken" 2021-06-12 13:02:24 +00:00
Chiachang Wang
8afa20e5d2 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
Change-Id: Icd4a1b2316608ea03a4f7afb32e39400af71950c
2021-06-12 15:38:45 +08:00
Yan Yan
a42e8215d8 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
Change-Id: Idde90ce5e4fc6f56ad617d5ba9735b1bcc2ce8cd
2021-06-11 11:58:09 -07:00
Yan Yan
1f423e06e2 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
Change-Id: I8b7ee9272722aebdd84ca02475a6107ef61287a9
2021-06-11 11:53:07 -07:00
Yan Yan
df24620850 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
Change-Id: I57e2bbed2954e4c7de906caae20390f7aebac0e3
2021-06-11 11:35:12 -07:00
Yan Yan
0c60279648 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
Change-Id: Ib626a6c3999b7d682d0858e92d0dbb5138fdc45d
2021-06-11 11:34:52 -07:00
Yan Yan
80be81b302 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
Change-Id: Ia29540c7fd6848a89bfa2d25c6a87921e45d98da
2021-06-11 11:34:29 -07:00
Yan Yan
00db30f3a0 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
Change-Id: I53f59815d6cb879dae622fcbd17616564a97111a
2021-06-11 11:29:13 -07:00
Yan Yan
29487b12d5 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
Change-Id: I0e08a6ea299e6ad94d69806a2d76fa155653b62a
2021-06-11 11:27:44 -07:00
lucaslin
816cc626c8 Add a test to check if the VPN type is set or not
Bug: 184261389
Test: atest CtsHostsideNetworkTests:HostsideVpnTests#testDefault
Change-Id: I7ed5989ec767494c1033dc01242b32724e120c4e
2021-06-11 18:15:50 +08:00
Remi NGUYEN VAN
a6c06af0fa Merge "Revert "Use mockito-extended in FrameworksNetTests"" 2021-06-11 01:26:44 +00:00
Remi NGUYEN VAN
d15e52eca9 Merge changes I8d15b626,I993e8da9
* changes:
  Revert "Remove ConnectivityServiceTest signature perms use"
  Revert "Use shell permission to query current user"
2021-06-10 23:39:11 +00:00
xingdai
892a0ef152 Revert "Use mockito-extended in FrameworksNetTests"
This reverts commit 98b76cc2ec.

Reason for revert: <INSERT REASONING HERE>

b/190622577

Change-Id: Ief39f82875e6fa885829aea62eed00f2f2e6774e
2021-06-10 21:41:54 +00:00
lifr
e39741db1c Add test for ConnectivityService API isPrivateDnsBroken
Bug: 189161363
Test: atest android.net.cts.ConnectivityManagerTest
      atest CtsNetTestCasesLatestSdk:ConnectivityManagerTest
Change-Id: Ib45aa439683d48360652a91d7a0609dc82adda33
2021-06-11 05:32:00 +08:00
Remi NGUYEN VAN
3cd164225b Revert "Remove ConnectivityServiceTest signature perms use"
This reverts commit bba8ec0d43.

Reason for revert: Broken tests b/190622577

Change-Id: I8d15b626fcd8da67094ebf461d381b3922f69024
2021-06-10 15:05:47 +00:00
Remi NGUYEN VAN
499219702b Revert "Use shell permission to query current user"
This reverts commit 95bc8d7067.

Reason for revert: Conflict with revert for b/190622577

Change-Id: I993e8da9737634d0cc815cd75b461699170602cc
2021-06-10 15:05:17 +00:00
Treehugger Robot
b9d05685fc Merge "Partial revert of "Remove ConnectivityServiceTest signature perms use"" 2021-06-10 14:35:25 +00:00
Paul Hobbs
cdfeb11719 Partial revert of "Remove ConnectivityServiceTest signature perms use"
This reverts the Android.bp changes in commit
bba8ec0d43.

Reason for revert: This broke ConnectivityServiceTest (https://android-build.googleplex.com/builds/tests/view?invocationId=I90700009364410436&testResultId=TR01525128446370769)

A full revert has a merge conflict in the other file, and is likely
not necessary to fix the failure.

Change-Id: Icc0c2500590a6b936016574be4f234b9f748cb80
2021-06-10 08:43:44 +00:00
Remi NGUYEN VAN
dbb2a23a38 Merge "Use shell permission to query current user" 2021-06-10 05:19:57 +00:00
James Mattis
fa270db5f7 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

Change-Id: I5a47dcece31749293f080af060218d827082eb67
2021-06-09 19:59:56 -07:00
Remi NGUYEN VAN
45f922a2ff Merge "Deprecate MANAGE_ACTIVITY_STACKS permission" 2021-06-09 23:45:29 +00:00
Treehugger Robot
3a1a22b82a Merge "Skip CaptivePortalTest for wearables" 2021-06-09 17:59:04 +00:00