Commit graph android_packages_modules_Co.../tests/net/java/com/android
Message SHA1
Merge "Fix SocketKeepalive APIs which do not meet API review requirement" am: 66bc22760a am: 7246f1a563
am: 0f69af35db

Change-Id: I873a82de90efce6f3baa17761c0576dc9c8210be

Junyu Lai   authored and   android-build-merger   commited 2019-03-25 04:16:18 -07:00
40ad433f92
Fix SocketKeepalive APIs which do not meet API review requirement
Per API review, change the use of FileDescriptor to
ParcelFileDescriptor.
This change also fix nullability according to API review
feedbacks.

Fix: 126698610
Fix: 126699425
Fix: 126699232
Fix: 126700278

Test: 1. m -j
      2. atest FrameworksNetTests --generate-new-metrics 50
      3. m -j doc-comment-check-docs
Change-Id: I19476c50dd1ca290bf3f41973829da2bd229796a

junyulai   commited 2019-03-25 15:56:35 +08:00
7e06ad4ce9
Merge "Temporarily disable flaky test." am: a7f5cf3adb am: d7a9e6da54
am: 70cb4b5281

Change-Id: I583ed9aa0e42e864ef0c1e74fbcd9357e093cc25

lucaslin   authored and   android-build-merger   commited 2019-03-21 08:39:31 -07:00
ea54b7ef6b
Merge "Temporarily disable flaky test."
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-03-21 15:04:15 +00:00
a7f5cf3adb
Temporarily disable flaky test.
Test: None
Bug: 128426024
Change-Id: I6fa12e50decbafe9d934030865c5a8f20d42b86f

lucaslin   commited 2019-03-21 19:14:32 +08:00
3bc80ae915
Merge "Cleanup NetworkManagementService for Netd commnads binder migrartion" am: df7d47d182 am: 17745f6602
am: 063cfac0f0

Change-Id: Ib6730d87eeebcd82964feeb96d12c09ae652d0d5

Luke Huang   authored and   android-build-merger   commited 2019-03-20 23:40:30 -07:00
1f5862ef2a
Merge "Cleanup NetworkManagementService for Netd commnads binder migrartion"
Luke Huang   authored and   Gerrit Code Review   commited 2019-03-21 06:01:25 +00:00
df7d47d182
Merge "Improve partial connectivity" am: 8d77a4b813 am: a3ab397e1f
am: 4569a46522

Change-Id: I25f9d056c26bf947c2e09516da51b627c3da9685

Lucas Lin   authored and   android-build-merger   commited 2019-03-20 21:15:34 -07:00
5026c330f2
Merge "Improve partial connectivity"
Lucas Lin   authored and   Gerrit Code Review   commited 2019-03-21 03:34:30 +00:00
8d77a4b813
Cleanup NetworkManagementService for Netd commnads binder migrartion
remove dead code used for netd UNIX sokcet

Bug: 65862741
Test: atest NetworkManagementServiceTest FrameworksNetTests
Change-Id: I5db61cb86325b71ac8a8fce7b15dbf569abc5935

Luke Huang   commited 2019-03-20 20:02:24 +08:00
ca5270422a
Improve partial connectivity
Improve the design and fix some nits.

Bug: 113450764
Test: 1. Build pass
      2. atest FrameworksNetTests
      3. atest NetworkStackTests
      4. Change captive_portal_https_url to https://invalid.com
      to simulate partial connectivity.
Change-Id: Ia56645841d00d2ed8406cfeacb86a4a27fd58650

lucaslin   commited 2019-03-20 18:21:59 +08:00
f9bff5b0dc
Merge "Add unit tests related to data accounting for VPNs with one underlying network." am: 43c87768e0 am: 5df3d62d01
am: 12f4d3d7e3

Change-Id: I80e3ebb556ac0b6bff5d232b881f7d869cb74f00

Varun Anand   authored and   android-build-merger   commited 2019-03-19 09:47:04 -07:00
b5d1b24eb0
Merge "Add unit tests related to data accounting for VPNs with one underlying network."
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-03-19 16:18:28 +00:00
43c87768e0
Merge "Remove NetworkParcelable" am: 7b9d4803b6 am: d7f138704b
am: 3f8edc8006

Change-Id: Ifec0dd683bf9c9b73c4af12835b76d284559daf8

Remi NGUYEN VAN   authored and   android-build-merger   commited 2019-03-17 19:12:02 -07:00
5734499deb
Merge "Remove NetworkParcelable"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-03-18 01:30:25 +00:00
7b9d4803b6
Add unit tests related to data accounting for VPNs with one underlying
network.

This is to establish a baseline for the existing behavior, and to ensure
that following changes are not causing a regression in existing
behavior.

This CL is also adding missing cleanup for NetworkStatsCollectionTest
which was forcing all network types in NetworkTemplate that was causing
NetworkStatsService related tests to fail.

Bug: 113122541
Bug: 120145746
Test: atest FrameworksNetTests
Change-Id: I285f186cfb16bc9fa704c797996b1e4f8a73dee4

Varun Anand   commited 2019-03-15 17:23:28 -07:00
3a84b3cee7
Remove NetworkParcelable
With the @JavaOnlyStableParcelable annotation, Network can now be used
as-is as a framework parcelable.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 126477266
Change-Id: I5d9695a31b3ac48d10edcf08ccd0c34375353b79

Remi NGUYEN VAN   commited 2019-03-16 03:51:09 +09:00
eb42f2f9e7
Merge "[KA02.5] Use binder thread and executor to invoke callback" am: f9ae70a41c am: c93f9c7f0e
am: 06ea4015bf

Change-Id: I881c1ab09187ab23facc03bb71cc38a7978e442c

Junyu Lai   authored and   android-build-merger   commited 2019-03-15 01:19:55 -07:00
9a4fe7fb2b
[KA02.5] Use binder thread and executor to invoke callback
Currently, client side of keepalive event handling rely on a
newly created thread, looper, messenger and handler per object.

However, by creating oneway AIDL interface with the executor,
the callbacks can be invoked on the binder thread with user
specified context, which not only greatly simplify the design
but also reduce the cost of current thread modeling.

Bug: 114151147
Bug: 123969871
Test: 1. atest FrameworksNetTests --generate-new-metric 10
      2. atest-deflake.sh

Change-Id: I27504074cd28d5b5eb94a7ec0e97ebaaaaa1ae3d

junyulai   commited 2019-03-14 19:24:12 +08:00
070f9ff460
Merge "Temporarily disable flaky test." am: 89351e03ed am: ead65bd578
am: b08ebd5e39

Change-Id: Ifcfee2d83c2a173f1cc2f22597aff3cffe558281

Ian Kasprzak   authored and   android-build-merger   commited 2019-03-12 22:40:38 -07:00
0515792497
Merge "[KA13]: add unit test for exposed TCP socket keepalive API." am: 87b73b01df am: f4b7872afa
am: 82383d0f6e

Change-Id: Ib2b2474a74e2e84b3bb75c36b518ad48009065af

Xiao Ma   authored and   android-build-merger   commited 2019-03-12 22:19:28 -07:00
f352c01bc2
Merge "Tell the factory it is already serving a request."
Chalard Jean   authored and   Gerrit Code Review   commited 2019-03-13 02:07:29 +00:00
11230da789
Merge "Temporarily disable flaky test."
Ian Kasprzak   authored and   Gerrit Code Review   commited 2019-03-13 01:52:21 +00:00
89351e03ed
Merge "[KA13]: add unit test for exposed TCP socket keepalive API."
Xiao Ma   authored and   Gerrit Code Review   commited 2019-03-13 01:13:08 +00:00
87b73b01df
Temporarily disable flaky test.
Test: None
Bug: 128426024
Change-Id: Id88bf452f41f512703d5831e357d9ba72dc5b911

Lorenzo Colitti   commited 2019-03-13 09:23:54 +09:00
321475fe7e
Tell the factory it is already serving a request.
This is a cherry-pick of ag/607226 that has been rebased on
top of four years of changes and with comments addressed.

Gives each factory a serial number and propagates it to every
NetworkAgent so when a score comes back indicating a request is
being handled the factory can account for it properly.

Without this, a new request that's already handled by a network
offered by a factory will not cause an increment of the factorys
ref count. Concretely this results in issues like the RAT icon
not being displayed in spite of the network actually being up
and usable.

This will be ported to AOSP as soon as possible, but immediately
some master-only WiFi tests need to be adjusted with this change
which would not let me submit to AOSP.

Bug: 18637384
Bug: 29030667
Test: manual
Test: atest frameworks/opt/telephony/tests/telephonytests
Test: atest frameworks-net
Test: atest CtsNetTestCases CtsHostsideNetworkTests
Change-Id: I597ac588f76dd507512ff02868fd1310b7e63f7e
Merged-In: I597ac588f76dd507512ff02868fd1310b7e63f7e

Chalard Jean   commited 2019-03-12 21:47:21 +09:00
29d06db64b
Merge "[CS] Support "instant failure" from factories"
Chalard Jean   authored and   Gerrit Code Review   commited 2019-03-12 12:04:46 +00:00
dce527fbd6
Merge "Check if network has partial connectivity" am: 2d3cc4577a am: 0ea87a4edb
am: 973a569390

Change-Id: Ib6c5ecc8238e1ac237eddcc00802fa5e7c0e24b9

Lucas Lin   authored and   android-build-merger   commited 2019-03-12 01:47:25 -07:00
1f01518b68
[KA13]: add unit test for exposed TCP socket keepalive API.
Bug: 123987272
Test: atest FrameworksNetTests
Change-Id: I543d8f00ae539b706592a149981e3e8992999284

Xiao Ma   commited 2019-03-12 17:30:47 +09:00
fcd1ab6aaf
Check if network has partial connectivity
In some networks, network validation may only get success
result for http probe but fail result for https probe.
For this kind of network, it may still work at some websites
or apps, but user didn't know about that. In order to fix this
issue, we will check if network has partial connectivity and
notify user to make a choice if they want to use this partial
connectivity or not.

Bug: 113450764
Test: 1. Build pass.
      2. Fake partial connectivity case for testing.
      3. atest FrameworksNetTests
      4. atest NetworkStackTests

Change-Id: I69ed00ac4850904ff708c9fef22e148879a10e92

lucaslin   authored and   Lucas Lin   commited 2019-03-12 07:37:33 +00:00
2240ef679d
[CS] Support "instant failure" from factories
Add a mechanism by which a factory can declare "instant failure" for
a request - which would result in it getting an OnUnavailable()
(even without a timeout).

Factories may only do this iff:
1. They know they are the only factory which may fulfill this
   request (common for transport-specific requests).
2. The know that the request can definitely not be
   fulfilled at any point in the future.

Bug: 31382922
Test: atest ConnectivityServiceTest
Merged-In: I9bce0f4d85fa8cad7f8a9998819f945b778c5ac5
Change-Id: I9bce0f4d85fa8cad7f8a9998819f945b778c5ac5

Etan Cohen   commited 2019-03-11 16:15:43 -07:00
fbfdd84e7c
Merge "Migrate frameworks/base/tests/net/ to androidx.test" am: e69a7a1554 am: 29e6ab8d01
am: 38f02479d6

Change-Id: I01657671712799f5a29a3a7530430cc5bfb14f41

Brett Chabot   authored and   android-build-merger   commited 2019-03-06 22:10:32 -08:00
8e95e2105d
Merge "Migrate frameworks/base/tests/net/ to androidx.test"
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-03-07 05:42:07 +00:00
e69a7a1554
Migrate frameworks/base/tests/net/ to androidx.test
Test: atest FrameworksNetTests
Change-Id: Iaa59d606f5e1678cc5aaca9ed37e184fad894e5d

Brett Chabot   commited 2019-03-05 09:05:47 -08:00
147f6cf341
Merge "Fix isActiveNetworkMetered for VPNs." am: 8cf699851a am: cb011b799f
am: 08bd075e35

Change-Id: I3d536324052227bbfab31ba5d608c35ecb9b1ab5

Varun Anand   authored and   android-build-merger   commited 2019-03-04 18:09:07 -08:00
3668aa0dd7
Merge "Fix isActiveNetworkMetered for VPNs."
Varun Anand   authored and   Gerrit Code Review   commited 2019-03-05 01:37:30 +00:00
8cf699851a
Merge "Remove ConnectivityManager and its usages from NetworkStatsService."
Varun Anand   authored and   Android (Google) Code Review   commited 2019-03-01 01:14:34 +00:00
c839241101
Remove ConnectivityManager and its usages from NetworkStatsService.
NSS needed it for getting VpnInfo[], NetworkState[] and
activeLinkProperties which it used to query via ConnectivityManager.

For VpnInfo[], this was racy as NSS may ignore intermediate changes to a
VPN's underlying networks. See http://b/123961098 for more context.

It may also lead to deadlocks b/w ConnectivityService and
NetworkStatsService. See http://b/126245192 for more info.

This change will ensure that NSS is never contending on any of
ConnectivityService locks.

Bug: 123961098
Bug: 126245192
Bug: 120145746
Test: atest FrameworksNetTests
Change-Id: Id1da446b54d95ee68ed14079107b1a10318bcf8b
Merged-In: I57e117bb4e9efe491b19d6b5a479f2d58d1c58e6

Varun Anand   commited 2019-03-01 00:10:52 +00:00
f3fd8dd454
Remove ConnectivityManager and its usages from NetworkStatsService.
NSS needed it for getting VpnInfo[], NetworkState[] and
activeLinkProperties which it used to query via ConnectivityManager.

For VpnInfo[], this was racy as NSS may ignore intermediate changes to a
VPN's underlying networks. See http://b/123961098 for more context.

It may also lead to deadlocks b/w ConnectivityService and
NetworkStatsService. See http://b/126245192 for more info.

This change will ensure that NSS is never contending on any of
ConnectivityService locks.

Bug: 123961098
Bug: 126245192
Bug: 120145746
Test: atest FrameworksNetTests
Change-Id: I57e117bb4e9efe491b19d6b5a479f2d58d1c58e6

Varun Anand   commited 2019-02-28 13:43:02 -08:00
45406bff69
Fix isActiveNetworkMetered for VPNs.
This change is basically a revert of http://ag/3580901.
It was made because previously VPN capabilities did not use to update
based on its underlying networks. That is no longer the case anymore.

This was previously returning meteredness on the basis of VPN's first
underlying network which is incorrect in cases such as VPN using
multiple underlying networks, or VPN that has explicitly marked itself
as metered via VpnService.Builder#setMetered API.

Bug: 123936838
Test: atest FrameworksNetTests
Change-Id: Ia54b8570fbad4a638a6d43a95e0271c6baf66685

Varun Anand   commited 2019-02-28 13:18:11 -08:00
83b6d76c93
Merge changes from topic "nat64" am: 868f0589c8 am: 17fdfe9945
am: 3998251274

Change-Id: Iffd1a988d631c9285bad232cc60ae321abc866e8

Lorenzo Colitti   authored and   android-build-merger   commited 2019-02-27 16:37:43 -08:00
a777182a7b
Merge changes from topic "nat64"
* changes:
  Catch ServiceSpecificException instead of IllegalStateException.
  Manage NAT64 prefix discovery lifecycle in the framework.
  Track NAT64 in the framework and start clatd iff NAT64 detected
  Change Nat464Xlat lifecycle.
  Minor improvements to verifyTcpBufferSizeChange.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2019-02-27 23:37:42 +00:00
868f0589c8
Manage NAT64 prefix discovery lifecycle in the framework.
Currently NAT64 prefix discovery, which runs in netd, is started
by netd itself when a network is programmed with all-IPv6 DNS
servers. Unfortunately this is not correct because in many cases
we program DNS servers before the network is connected and it's
actually possible to send packets to them.

In general netd does not have enough visibility into network
lifecycle management to decide when to start and stop prefix
discovery. So move it into the framework with the rest of the
464xlat control plane.

Bug: 65674744
Test: atest FrameworksNetTests
Change-Id: I8fa051a9c216d9c05082bf7d0bbb0cbd56000162

Lorenzo Colitti   commited 2019-02-27 00:18:13 +09:00
84298d8e5e
Track NAT64 in the framework and start clatd iff NAT64 detected
Currently, both netd and clatd do NAT64 prefix detection, and we
start clatd on all IPv6-only networks regardless of whether netd
has detected a NAT64 prefix or not.

Instead, track the NAT64 prefix in the framework, and only start
clatd if the prefix is detected. This will allow us to remove
DNS64 detection in clatd, and pass the NAT64 prefix and the IPv6
address to clatd on the command line instead of clatd finding it
itself. That way, netd and the framework will always know how
464xlat is configured, and we'll be able to use that information
in netd.

Test: builds, boots
Test: atest FrameworksNetTests
Change-Id: Ida32d5760c5aecf7aeebef08fdb596291b2ce14a

Lorenzo Colitti   commited 2019-02-25 11:42:00 +09:00
f7e1739d9b
Change Nat464Xlat lifecycle.
Currently, NetworkAgentInfo keeps a Nat464Xlat object only on
networks where we're starting clatd (i.e., IPv6-only networks).
Simplify this code by making the Nat464Xlat object final and
always non-null. This allows us to use Nat464Xlat to store
information, such as the NAT64 prefix, even if the clat daemon
has not been started yet.

Also, remove the STOPPING state which waits for the interface to
be removed. Instead, when stop() is called, immediately enter the
IDLE state.
- This is necessary in order to be able to call start() again
  before the interface removal notification has arrived.
- It's also arguably more correct than the current code,
  because when stop() returns clatd has already terminated
  (ClatdController::stopClatd calls waitpid), and thus the tun
  fd is already closed and the tun interface is gone.

Also, now that Nat464Xlat objects are reused after stop(), add
test coverage for calling start() after stop, in both cases:
- The notification that the previous interface was removed
  arrives before the second start().
- The notification that the previous interface was removed
  arrives after the second start() but before the notification
  that the second interface was added.

Also fix a couple of lint warnings.

Test: builds, boots
Test: atest FrameworksNetTests
Test: clatd stops when IPv4 address added
Test: clatd restarts after "adb shell killall clatd"
Change-Id: I3dc66d155aa27606681f3473daf2170434d8c6d0

Lorenzo Colitti   commited 2019-02-25 11:42:00 +09:00
7b0732fff7
Minor improvements to verifyTcpBufferSizeChange.
1. Remove "throws Exception" from the signature so it can be used
   in tests that do not already throw Exception.
2. Update comment to reflect the fact that TCP buffer sizes are
   set on default network switch, not on connect.
3. Move into the method a class-level static constant that is
   only used in that method.

Test: atest ConnectivityServiceTest
Change-Id: Ic2e4fbedc23065efc20e45ea84996b577a8e94b6

Lorenzo Colitti   commited 2019-02-25 11:41:50 +09:00
c11592ce7c
Merge "[CS] Support "instant failure" from factories"
Etan Cohen   authored and   Android (Google) Code Review   commited 2019-02-22 14:29:39 +00:00
bd51b3057a
Merge "Skip unreachable route when estimating VPN destinations" am: e26fb9d574 am: fab8b096c3
am: dcdc2174af

Change-Id: Id81038035eddf98d0c4546ddb25c8f6ed5736ad6

Rubin Xu   authored and   android-build-merger   commited 2019-02-20 04:35:38 -08:00
e70e6ddd39
Merge "Skip unreachable route when estimating VPN destinations"
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-02-20 12:00:15 +00:00
e26fb9d574
Skip unreachable route when estimating VPN destinations
Bug: 122652441
Test: atest com.android.server.connectivity.VpnTest
Test: Establish a IPv4 VPN with minimal routes and check
(dumpsys connectivity) the VPN network does not have INTERNET
capability.

Change-Id: Ic7f19ebb7b7f78a6ffb2a8ec3fc3eca5e5421f57

Rubin Xu   commited 2019-02-19 17:18:34 +00:00
8b1352fdaa