Commit Graph

8946 Commits

Author SHA1 Message Date
Cody Kesting
05d04fe553 Merge "Set owner and administrator UIDs for test networks." into rvc-dev 2020-05-14 18:56:16 +00:00
android-build-team Robot
90b43fb732 Snap for 6493843 from 38b4ec9127c102c32f43bf54c0da164f9b6f5685 to mainline-release
Change-Id: I5f1314d39a5a842efaf45f7b554128d1da8d9303
2020-05-14 07:00:45 +00:00
Remi NGUYEN VAN
05c7af6c7c Use the new NetworkStackConnector constructor
The constructor was changed to allow for unit tests.

Bug: 137328719
Test: atest FrameworksNetIntegrationTests
Original-Change: https://android-review.googlesource.com/1295360
Merged-In: I46f247268310e12d420531745a22e93cf3550e89
Change-Id: I46f247268310e12d420531745a22e93cf3550e89
2020-05-13 09:18:52 +00:00
android-build-team Robot
060cbc6d0e Snap for 6489494 from 73817bc8997d03370d42be20dbb095cf3759d9d5 to mainline-release
Change-Id: I04ac11c5af37d8f50972dde8bbf99ac173964fc2
2020-05-13 07:02:59 +00:00
Remi NGUYEN VAN
d9e1872964 Merge "Send full LinkProperties to NetworkMonitor" into rvc-dev 2020-05-13 00:34:41 +00:00
Automerger Merge Worker
9ddf8a5953 Create TestApi for simulating a Data Stall on ConnectivityService.
This change adds a TestApi for simulating a Data Stall to
ConnectivityService. This allows for Data Stalls to be triggered without
having to manipulate the signals used by NetworkMonitor . This also
allows NetworkMonitor to update the ways it detects Data Stalls without
affecting CTS tests for ConnectivityDiagnosticsManager.

Bug: 148032944
Test: atest ConnectivityDiagnosticsManagerTest
Change-Id: Icad439efa2ab4c872c21d3ee6ceaae8c5b49f18d
Merged-In: Icad439efa2ab4c872c21d3ee6ceaae8c5b49f18d
(cherry picked from commit b06463a002eb6215e9dda64e599eabd74cb56382)
2020-05-12 20:34:50 +00:00
Cody Kesting
a9b761d261 Set owner and administrator UIDs for test networks.
This change sets the owner and administrator UIDs for test networks when
their initial values match the UID for the app creating the test
network. This ensures that apps registering test networks can only make
themselves owners / administrators of the network.

Bug: 153449964
Test: atest NetworkAgentTest
Change-Id: I3a974700aa1d83cb285295ed1de0aa263e2e5b58
Merged-In: I3a974700aa1d83cb285295ed1de0aa263e2e5b58
(cherry picked from commit 35782280a2adceec96b8e03c217788afa05894a0)
2020-05-12 20:33:42 +00:00
Remi NGUYEN VAN
2c4a47d65c Send full LinkProperties to NetworkMonitor
Set the parcelSensitiveFields bit when sending LinkProperties to
NetworkMonitor, so that the captive portal API URL is not lost.

Test: atest ConnectivityServiceIntegrationTest (see followup change)
Bug: 156062304
Original-Change: https://android-review.googlesource.com/1307833
Merged-In: Ifd4e9c02a6b9a2b2b8b254fc4da7bfb9e0a84550
Change-Id: Ifd4e9c02a6b9a2b2b8b254fc4da7bfb9e0a84550
2020-05-12 09:14:38 +00:00
Benedict Wong
bfd3c75dce Add tests for Tunnel, Transport mode application with released SPIs
This change adds tests to validate that both transport and tunnel mode
transforms continue to work even after the SPI resource has been
released. Specifically, since SPI resources are effectively subsumed by
the creation of a Transform, the SPI resource is still "alive", but
removed from the user-tracking sparse arrays.

Bug: 142072071
Test: Added these new tests. Failing prior to aosp/1133555, passes with.
Change-Id: I37dd459d08b57b14f72f3b28ea80fa231b152f10
Merged-In: I37dd459d08b57b14f72f3b28ea80fa231b152f10
(cherry picked from commit 4d3f871a944d24cd7cbe3aa51a789a71020eafb5)
2020-05-08 00:01:59 -07:00
Benedict Wong
2d70990d2c Use TransformRecord to get SPI instead of SpiRecord
IpSecService.applyTunnelModeTransform() currently does not take an
SpiRecord instance, yet implicitly requires that the SpiRecord instance
is still alive based on the stored SpiRecord resourceId in
the TransformRecord's IpSecConfig.

This check is unnecessary, as the SpiRecord has been subsumed into the
TransformRecord, and the kernel resources are kept alive whether or
not the SpiRecord is still held by the user.

This allows users of the IpSecManager API to allocate short-lived SPIs
during the creation of an IpSecTransform, without having to keep track
of both of them (even though the SPI is no longer usable).

The TransformRecord.getSpiRecord() call is already used in
multiple other places in the same method.

Bug: 142072071
Test: New tests added, passing.
Change-Id: I1959f3080946267243564459ff4207647922566e
Merged-In: I1959f3080946267243564459ff4207647922566e
(cherry picked from commit 5258b1b82f39bf17e0751bcb94479464250aaec5)
2020-05-08 00:01:45 -07:00
android-build-team Robot
9dd3cf292a Snap for 6450912 from 6b639d3eb3fc417ba2279b2265255b9e8c1d1157 to mainline-release
Change-Id: Ica89f4b346997c4a37ab5664a54383ac4c63c472
2020-05-01 07:00:38 +00:00
Remi NGUYEN VAN
1f6d977758 Merge "Add comment / logging in NetworkMonitor callbacks" into rvc-dev am: a294a88751
Change-Id: I57d8597082c7cf72494e5d16bb0ff7cbc83fba37
2020-05-01 00:51:42 +00:00
Remi NGUYEN VAN
a294a88751 Merge "Add comment / logging in NetworkMonitor callbacks" into rvc-dev 2020-05-01 00:32:07 +00:00
Rambo Wang
d1aff7bde8 Merge "Restrict match conditions of TelephonyNetworkSpecifier#canBeSatisfied" into rvc-dev am: c19bf4fb3f
Change-Id: If7fb76656075d1b54320902b69882a8fd64bfc12
2020-04-30 22:39:37 +00:00
Rambo Wang
c19bf4fb3f Merge "Restrict match conditions of TelephonyNetworkSpecifier#canBeSatisfied" into rvc-dev 2020-04-30 22:23:13 +00:00
Benedict Wong
1d3126b526 Merge "Add filtering for IPsec algorithms in IKEv2 VPNs" into rvc-dev am: 89ff63b804
Change-Id: I5c53eb9dcfc7d858e40f68cf20ddb684980ebaef
2020-04-30 17:40:55 +00:00
Benedict Wong
89ff63b804 Merge "Add filtering for IPsec algorithms in IKEv2 VPNs" into rvc-dev 2020-04-30 17:29:29 +00:00
Remi NGUYEN VAN
4193f33575 Merge "Address comments on NetworkStack AIDL v6" into rvc-dev am: cc9f73cad3
Change-Id: I58b6863e5f8417368c7cd83edc487404d5156e99
2020-04-30 06:19:07 +00:00
Remi NGUYEN VAN
3d3c9f7b76 Add comment / logging in NetworkMonitor callbacks
Add a comment explaining the ordering of messages sent to the tracker
and connectivity diagnostics handlers.

Add a Slog.wtf call in case the deprecated notifyNetworkTested callback
is called.

Bug: 153500847
Test: atest ConnectivityServiceTest
Merged-In: I2dbfc9bf7b2f785ea4594851bd354e9fd0fc0bd1
Change-Id: I2dbfc9bf7b2f785ea4594851bd354e9fd0fc0bd1
2020-04-30 06:12:18 +00:00
Benedict Wong
0fff1ed7b9 Add filtering for IPsec algorithms in IKEv2 VPNs
This commit adds support for validating and filtering IPsec algorithms.
Without a public API exposing IKEv2 algorithms (and their respective
public APIs), the allowedAlgorithms can only filter the proposals for
IPsec (Child) SA algorithms.

Additionally, this removes the HMAC_SHA1 from the IKE SA's integrity
algorithm proposals due to insecurity

Bug: 153701879
Test: FrameworksNetTests passing, new tests added
Change-Id: I7e61a1612692db275b751330af5bacbf86836a8c
Merged-In: I7e61a1612692db275b751330af5bacbf86836a8c
(cherry picked from commit 94e1c08a9ad4b0ff17e0f3a77fff0d3364040ba5)
2020-04-29 23:05:35 -07:00
Remi NGUYEN VAN
cc9f73cad3 Merge "Address comments on NetworkStack AIDL v6" into rvc-dev 2020-04-30 06:02:32 +00:00
TreeHugger Robot
dc73da17af Merge "Filter debug entries for each vpn" into rvc-dev am: 1913e1d29b
Change-Id: I0b1a9b7ffc65bfa6c784ec215e64371ab8d14e93
2020-04-30 04:20:40 +00:00
TreeHugger Robot
be93c81ba8 Merge "Add test prefix into test cases" into rvc-dev am: 2fe712700e
Change-Id: I613235e39111132b5627c5d72c2b2f589d5c9641
2020-04-30 03:35:14 +00:00
Chiachang Wang
bd16241678 Filter debug entries for each vpn
NetworkStats calculation needs to filter out debug entries to
prevent over counting. While NetworkStatsFactory migrates data
usage over a VPN to the TUN network, NetworkStatsFactory does
not filter out debug entries per vpn which will cause debug
entries left and cause exception.

Bug: 152678151
Test: atest com.android.server.net.NetworkStatsFactoryTest
      and verify no exception
Change-Id: I3525edc385b07858b48c7add2d331c4b5a2e84ad
Merged-In: I3525edc385b07858b48c7add2d331c4b5a2e84ad
2020-04-30 02:39:15 +00:00
Chiachang Wang
3cb1e03082 Add test prefix into test cases
Bug: 152678151
Test: atest com.android.server.net.NetworkStatsFactoryTest
Change-Id: I6e18915e383ac20072cb238d0136d7a8e4ceb811
Merged-In: I6e18915e383ac20072cb238d0136d7a8e4ceb811
2020-04-30 02:38:18 +00:00
Remi NGUYEN VAN
f577197908 Address comments on NetworkStack AIDL v6
Address issues found during AIDL review:
 - Rename clientAddr to singleClientAddr
 - Do not use a ParcelableBundle for notifyNetworkTested or
   notifyDataStallSuspected; instead use AIDL parcelables for stronger
   backwards compatibility guarantees.

Test: atest NetworkMonitorTest ConnectivityServiceTest
      ConnectivityServiceIntegrationTest, manual
Bug: 153500847
Merged-In: Id9b71784e5f6294d203230e57737979e063ff0f8
Change-Id: Id9b71784e5f6294d203230e57737979e063ff0f8
2020-04-28 08:09:17 +00:00
Rambo Wang
3745c39f98 Restrict match conditions of TelephonyNetworkSpecifier#canBeSatisfied
TelephonyNetworkSpecifier will now treat null as matching nothing. When
the request specifies a TelephonyNetworkSpecifier while the network does
not, this should not be treated as a match.

Bug: 154703135
Test: atest android.net.TelephonyNetworkSpecifierTest
Change-Id: I329110e929995c9eae6c6ce33b5414777acea1e1
2020-04-27 14:25:39 -07:00
android-build-team Robot
b0da049792 Snap for 6431658 from 7fce13eef456b209b4f1d489da3e2cd8eed432b5 to mainline-release
Change-Id: Iaf97a4c5198d586974b6db6e113ba7fdfb4b7884
2020-04-26 07:12:23 +00:00
android-build-team Robot
54ef50d232 Snap for 6425864 from 4dd2f7092132f87f9819171040e05f02c184c139 to mainline-release
Change-Id: I75b66a8bd5baa4ab818020433bec74043b10f065
2020-04-24 07:04:31 +00:00
TreeHugger Robot
b09dd19436 Merge "Move DhcpInfoTest to frameworks/base/tests/net/common" into rvc-dev am: 89930cbb29
Change-Id: I87c6ff9698d9f8fadea6139359f7479a72adc965
2020-04-24 06:27:51 +00:00
TreeHugger Robot
89930cbb29 Merge "Move DhcpInfoTest to frameworks/base/tests/net/common" into rvc-dev 2020-04-24 06:15:13 +00:00
TreeHugger Robot
5d74bf5bca Merge "Add test for NetworkSpecifier" into rvc-dev am: 326ac97692
Change-Id: I0e345d63b92fa83c4aa274481f9c669db24eb1f3
2020-04-24 01:34:51 +00:00
Treehugger Robot
22ef3a8747 Add test for NetworkSpecifier
Tests for canBeSatisfiedBy() and redact()

Bug: 154686765
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkSpecifierTest
Change-Id: Iade6a5b355b8812a5eb191345dfe393938ee272c
Merged-In: Iade6a5b355b8812a5eb191345dfe393938ee272c
(cherry picked from commit ae84f1ac325e54f021c720744c787b66525d12ea)
2020-04-24 00:09:55 +00:00
android-build-team Robot
d7e65c9683 Snap for 6417465 from ad89080ba2dd7bf789abb8e538a2ac6c8b5adec2 to mainline-release
Change-Id: Ie94a81b8cea99a2f626daa5598d92a998de3399d
2020-04-22 07:09:26 +00:00
Lorenzo Colitti
a7068abb33 Merge "Stop prefix discovery if an RA prefix arrives in DISCOVERING" into rvc-dev am: 83eb86b247
Change-Id: If85833c1a62b96830cbfeea7bd734190b2d8f1c3
2020-04-21 10:25:44 +00:00
Lorenzo Colitti
ec9291dea8 Merge "Make the Nat464Xlat tests more realistic." into rvc-dev am: 840bb2ea6f
Change-Id: I733c6565f93a6ab7e19b39f86a3c90837cfa4485
2020-04-21 10:23:37 +00:00
TreeHugger Robot
5bf2f09286 Merge "Add network agent to enhance NetworkProvider test" into rvc-dev am: eb92e57996
Change-Id: I57c49e657d1d07d4c15df4893c9e9f3fe984aa11
2020-04-21 10:23:10 +00:00
Lorenzo Colitti
5cb69679b1 Merge "Support learning the NAT64 prefix from two different sources." into rvc-dev am: 4f7f6d67e9
Change-Id: I930d63aa0364a20141cd8e096a1a8b88e3b81fa7
2020-04-21 10:21:08 +00:00
Lorenzo Colitti
83eb86b247 Merge "Stop prefix discovery if an RA prefix arrives in DISCOVERING" into rvc-dev 2020-04-20 14:29:29 +00:00
Lorenzo Colitti
840bb2ea6f Merge "Make the Nat464Xlat tests more realistic." into rvc-dev 2020-04-20 14:19:53 +00:00
TreeHugger Robot
eb92e57996 Merge "Add network agent to enhance NetworkProvider test" into rvc-dev 2020-04-20 14:18:10 +00:00
Aaron Huang
4f5455fb44 Add network agent to enhance NetworkProvider test
Add network agent to test more situation that could get the
onNetworkRequested callback.

Bug: 153614605
Bug: 153613690
Bug: 153612373
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkProviderTest
Change-Id: I7f827710b47546bd4419cc1ff06f03ec4635583d
Merged-In: Id494a1697cc1b73e8e56ae585a69faec31c59f52
(cherry picked from commit 9e92e57fd70944cbe8bb61bbb7a5fa728d0e68f5)
2020-04-20 12:13:03 +00:00
Lorenzo Colitti
c9016cafe3 Stop prefix discovery if an RA prefix arrives in DISCOVERING
Currently, if a prefix is learned from an RA while prefix
discovery is running, clatd will be correctly started, but
prefix discovery will be stopped.

In order to fix this, make it possible to call
stopPrefixDiscovery without transitioning to IDLE state (which
is obviously necessary in this case), by moving the assignment of
the next state from that method to its callers. For consistency,
do the same for startPrefixDiscovery.

Bug: 150648313
Test: new test coverage
Change-Id: I3803fa3d9806848b331c35ee8bac256934bd1f21
Merged-In: I3803fa3d9806848b331c35ee8bac256934bd1f21
(cherry picked from commit c7c6f76402a989f91b02c37574b6a9de592cf1af)
2020-04-20 12:06:45 +00:00
Lorenzo Colitti
1c0d43fc15 Make the Nat464Xlat tests more realistic.
464xlat will never be started on a network that is not connected,
or on a network that has no IPv6 address.

This is a no-op test-only change but it is necessary for an
upcoming change that violates some of the invalid assumptions
currently made by this test and causes it to fail.

Bug: 150648313
Test: test-only change
Change-Id: I41766e9adaa7c24454648b371e6e3cc647693be5
Merged-In: I41766e9adaa7c24454648b371e6e3cc647693be5
(cherry picked from commit df0c522d18ee73c1d20cff1a1dc955b383e6c355)
2020-04-20 12:05:36 +00:00
Lorenzo Colitti
4308bfc4f0 Support learning the NAT64 prefix from two different sources.
The NAT64 prefix from the RA always takes precedence over the
NAT64 prefix from DNS discovery, because it is detected faster,
and detecting it does not require sending any packets.

Bug: 150648313
Test: new unit test
Merged-In: Ic7452431d2d9aea1ae59b67a9d8383c6cc5b3902
Change-Id: Ic7452431d2d9aea1ae59b67a9d8383c6cc5b3902
2020-04-20 11:53:00 +00:00
android-build-team Robot
3a757cba79 Snap for 6408566 from c69d7817ccbd692cb7e18639cedddacaa70d3bc3 to mainline-release
Change-Id: I2e798b7bba6ff31b4f2aa5e22fce0dc11515c822
2020-04-19 07:11:52 +00:00
Aaron Huang
f0a0642b97 Move DhcpInfoTest to frameworks/base/tests/net/common
Address comment from aosp/1162443.
Move to FrameworksNetCommonTests so that it can be run in
cts test and presubmit test.

Also change package name from android.net.cts to android.net

Bug: 154299158
Test: atest FrameworksNetTest
      atest CtsNetTestCasesLatestSdk:android.net.DhcpInfoTest

Change-Id: Ib6c9b7729ec4c348d94d025996efa9a1f436258b
Merged-In: I42a965ae5cb748fdd80b4d5c0f8b26f36f74be72
2020-04-17 17:38:45 +00:00
Aaron Huang
a01c48d651 Merge "This contains a squash of two changes >>>>>>>>>>>>>>>>>>>>>> aosp/1284588 Adjust permission of NetworkProvider related API" into rvc-dev am: 78ab633b8f
Change-Id: I2584b86082f224c6fdaa7e4ecc0aac52a92c3427
2020-04-17 11:01:29 +00:00
Aaron Huang
78ab633b8f Merge "This contains a squash of two changes >>>>>>>>>>>>>>>>>>>>>> aosp/1284588 Adjust permission of NetworkProvider related API" into rvc-dev 2020-04-17 10:32:13 +00:00
Aaron Huang
b9626ecd40 This contains a squash of two changes
>>>>>>>>>>>>>>>>>>>>>>
aosp/1284588
Adjust permission of NetworkProvider related API

- Allow an app holds NETWORK_SETTINGS to acess registerNetworkProvier()
  and unregisterNetworkProvider().
- To access declareNetworkRequestUnfulfillable(), allow an app holds
  MANAGE_TEST_NETWORKS to declare a unfulfillable request that contains
  TRANSPORT_TEST transport.

This makes easier to write cts to test.
>>>>>>>>>>>>>>>>>>>>>>
aosp/1285957
Add cts test for NetworkProvider

It will skip whole tests on Q device since NetworkProvider class
is introduced in R.

Result on Q device would be:
[1/1] android.net.NetworkProviderTest#skippedClassForDevSdkMismatch: IGNORED (3ms)
>>>>>>>>>>>>>>>>>>>>>>
Bug: 153614605
Bug: 153613690
Bug: 153612373
Test: atest FrameworksNetTests
      atest CtsNetTestCases:android.net.NetworkProviderTest
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkProviderTest
Change-Id: Ib6f42b8f0e94e8c2715a030587e065864edff25b
Merged-In: Ic9809e731aa811a51c2f82d189372169d99a5ed9
Merged-In: If7bfc7fae503e3497c37754697d0b148ff4cab3b
(cherry picked from commit 10138d42a8f3892fcdb129a39409efe42873f6fe)
2020-04-17 08:45:29 +00:00