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)
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)
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)
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Merged-In: Id4ae06840e1749997e970b8f1ec391060967bd47
Change-Id: Id4ae06840e1749997e970b8f1ec391060967bd47
This CL updates NetworkCapabilities to retain configured subscription
IDs for Test NetworkCapabilities. Previously, they were cleared in
restrictCapabilitiesForTestNetwork().
Bug: 182291467
Bug: 189125789
Test: atest Ikev2VpnTest IpSecManagerTunnelTest
Test: atest CtsVcnTestCases
Change-Id: I0e1bc617910c9e8ac7b431572f276b1611acc1cb
Merged-In: I0e1bc617910c9e8ac7b431572f276b1611acc1cb
(cherry picked from commit a262a9d3d5)
This CL updates TestNetworkService to fully setup test TUN
interfaces when created. Previously, the interface was only
created in netd when the Test Network was created.
Bug: 182291467
Bug: 189125789
Test: atest Ikev2VpnTest IpSecManagerTunnelTest
Change-Id: I4c1262e566517bbb03dd610f595e4d18bc4e7735
Merged-In: I4c1262e566517bbb03dd610f595e4d18bc4e7735
(cherry picked from commit 615237a818)