Commit Graph

8592 Commits

Author SHA1 Message Date
Lorenzo Colitti
16b28e2b22 Test that if an RA sets the same prefix as DNS, nothing happens.
This is not particularly likely to happen unless the pref64 RA is
sent by a different router than the main RA. But more tests are
always good, and this additional coverage will be more useful
in an upcoming change.

Bug: 150648313
Test: test-only change
Change-Id: I3316d49d42100800740afadc4edf0a13a4d8377c
2020-05-21 17:26:00 +09:00
Treehugger Robot
2911ce534e Merge "Suppress deprecation warnings in LegacyTypeTrackerTest." am: 8d55b55f60
Change-Id: If35be28eac763d01b99078f171da8ff56d90d93f
2020-05-21 08:11:05 +00:00
Treehugger Robot
8d55b55f60 Merge "Suppress deprecation warnings in LegacyTypeTrackerTest." 2020-05-21 07:47:45 +00:00
Lorenzo Colitti
84f1909fb1 Suppress deprecation warnings in LegacyTypeTrackerTest.
This saves dozens of warnings every time FrameworkNetTests is
compiled. There is nothing we can do about those warnings because
LegacyTypeTracker's reason for existence is to power deprecated
APIs.

Test: m FrameworksNetTests
Change-Id: I4d65b0aade493e12b56a94247efbf9d1ad7bb4b9
2020-05-20 20:53:16 +09:00
Remi NGUYEN VAN
d7b408a8d8 Merge "Add integration test for capport API" am: f2853503c3
Change-Id: I9e4ebb0e6746806a466544261def371eff4c8e21
2020-05-20 09:41:45 +00:00
Remi NGUYEN VAN
2ce373abf2 Add integration test for capport API
Add a test to verify the ConnectivityService / NetworkMonitor
integration around the captive portal API.

Test: atest ConnectivityServiceIntegrationTest
Bug: 156062304
Change-Id: I4eed02e09fc4943c011d871c58ba97ec572c7763
2020-05-20 15:11:14 +09:00
Chalard Jean
3cd880b4bb Adjust tests for renaming groupHint to cluster.
Bug: 146460486
Test: atest android.net.IpMemoryStoreTest
Test: atest com.android.server.connectivity.ipmemorystore.IpMemoryStoreServiceTest
Change-Id: I69f7a2971cc5985d0f0078aecc39d4d6a6130033
2020-05-20 14:37:17 +09:00
Cody Kesting
b37958eec9 Forward unknown Data Stall types to Connectivity Diagnostics.
This CL forwards suspected Data Stall events detected with unknown
detection methods to ConnectivityDiagnostics.

Currently, ConnectivityService drops any data stall events with unknown
detection methods, which leads to false negatives for Connectivity
Diagnostics registrants. This change ensures that registrants will still
be notified as NetworkStack is updated to use new detection methods.

The documentation for ConnectivityDiagnosticsManager#DataStallReport is
also updated to reflect that the detection methods included in the
report are a bit mask of detection methods used. Implicitly, this means
that data stalls detected via unknown methods will have an empty bit
mask (0x00).

Bug: 156294356
Test: atest ConnectivityDiagnosticsManager
Change-Id: I62d0bf91fcc17c7921afd519c72551399906bd6b
2020-05-19 10:57:29 -07:00
Treehugger Robot
379edab69e Merge "Add an exported flag in integration tests manifest" am: 8598423cc4
Change-Id: Iadfaca436895055de90e8018f881b07a6bab4bea
2020-05-19 09:58:50 +00:00
Treehugger Robot
8598423cc4 Merge "Add an exported flag in integration tests manifest" 2020-05-19 09:32:39 +00:00
Remi NGUYEN VAN
d68de90e40 Add an exported flag in integration tests manifest
(partial cherry-pick of internal change:
I4457ff2bd466a4c56fed2570e110f251031c2385)

With b/150232615, we will need an explicit value set for the exported
flag when intent filters are present, as the default behavior is
changing for S+. This change adds the value reflecting the previous
default to the manifest.

These changes were made using an automated tool, the xml file may be
reformatted slightly creating a larger diff. The only "real" change is
the addition of "android:exported" to activities, services, and
receivers that have one or more intent-filters.

Bug: 150232615
Test: TH
Merged-In: I4457ff2bd466a4c56fed2570e110f251031c2385
Change-Id: I65a1ca1678048bbf09edc9a0485b673644c8109d
2020-05-19 17:53:32 +09:00
Cody Kesting
5d19c0ae7f Merge "Move Data Stall logic to CS from NetworkMonitorCallbacks." am: feac618a1a
Change-Id: I0884098a86de1e96b93dd1c753d7863641f34f0b
2020-05-18 17:38:34 +00:00
Cody Kesting
feac618a1a Merge "Move Data Stall logic to CS from NetworkMonitorCallbacks." 2020-05-18 17:21:21 +00:00
Treehugger Robot
2dc15b02b2 Merge "Address nit from aosp/1301317" am: 1894a79964
Change-Id: I2443c5da4b69bce693a39e894c41db5b25b6cf03
2020-05-15 07:03:31 +00:00
Treehugger Robot
1894a79964 Merge "Address nit from aosp/1301317" 2020-05-15 06:43:42 +00:00
Benedict Wong
099b0b8700 Merge "Add methods for IKEv2/IPsec test mode profiles" am: 56b98b0206
Change-Id: I9ff22188a641fce6b7bd44f7619d1b825988667a
2020-05-15 02:35:39 +00:00
Benedict Wong
56b98b0206 Merge "Add methods for IKEv2/IPsec test mode profiles" 2020-05-15 02:18:02 +00:00
Benedict Wong
0d7bed76cb Add methods for IKEv2/IPsec test mode profiles
This change adds the ability for IKEv2/IPsec VPN profiles to run on Test
Networks. If enabled, the IKEv2/IPsec VPN profiles will request ONLY
test networks.

Bug: 148582947
Test: FrameworksNetTests passing
Test: Added for testing
Change-Id: I2511b39b27a1e29ae97907cdb12728d13fb1628f
2020-05-12 22:55:55 -07:00
Cody Kesting
f5cc4eae9e Move Data Stall logic to CS from NetworkMonitorCallbacks.
This change moves the logic for handling Data Stall notifications from
NetworkMonitorCallbacks to ConnectivityService. This avoids duplicate
logic for managing data stall simulation requests from
ConnectivityManager. This also puts all of the logic for proxying Data
Stall notifications to the ConnectivityDiagnosticsHandler into one
place.

Bug: 148032944
Test: atest ConnectivityDiagnosticsManagerTest
Change-Id: Ie2f6a1a2376c5c452750ab417cb5e8c24fc44fc3
2020-05-12 16:24:46 -07:00
Cody Kesting
b36fa34041 Merge "Create TestApi for simulating a Data Stall on ConnectivityService." am: e743a30aa7
Change-Id: Ie14ab9cbcf8f7b291fb88f4b4abedab1b5978c3e
2020-05-12 17:10:10 +00:00
Cody Kesting
f9877d902e Merge "Set owner and administrator UIDs for test networks." am: 2ba1b8ecd1
Change-Id: I3b1c29b30912c4dddc3524a9a28fb3ad8c3ac318
2020-05-12 17:09:14 +00:00
Cody Kesting
e743a30aa7 Merge "Create TestApi for simulating a Data Stall on ConnectivityService." 2020-05-12 16:52:35 +00:00
Cody Kesting
2ba1b8ecd1 Merge "Set owner and administrator UIDs for test networks." 2020-05-12 16:52:07 +00:00
Remi NGUYEN VAN
167f06836c Merge "Send full LinkProperties to NetworkMonitor" am: bdbe7b72fe
Change-Id: Ib33f33a1998b61b980315e7278162e57f8f56cf2
2020-05-12 08:37:41 +00:00
Remi NGUYEN VAN
bdbe7b72fe Merge "Send full LinkProperties to NetworkMonitor" 2020-05-12 08:13:05 +00:00
Chalard Jean
e428a22b07 Merge "Fix a bug where VPNs start out suspended on cellular" am: bd3a7f994d
Change-Id: Ic28ed72f30d49da7bd137b4d4db125b895025ed0
2020-05-11 04:46:46 +00:00
Chalard Jean
4f8109f638 Address nit from aosp/1301317
Test: atest ConnectivityServiceTest#testVpnSetUnderlyingNetworks
Bug: 150570873
Change-Id: If5e5439b22f05e08a293fd83da4d54f6a4363ca5
2020-05-11 13:25:16 +09:00
Chalard Jean
fbd6a2c012 Fix a bug where VPNs start out suspended on cellular
As NetworkAgent is in a transition where all agents need
to include the NOT_SUSPENDED capability as part of their
migration to the system API, ConnectivityService adds it
forcefully to all agents that don't have the CELLULAR
transport. This doesn't include VPNs when VPNs have some
cellular network as their underlying network.

The best way to solve this is to make sure the VPN
capabilities reflect those of the underlying networks as
far as the NOT_SUSPENDED capability is concerned. This
is how they work for other similar capabilities.

This also happens to contain a drive-by fix for an issue
with a spurious capabilities callback is triggered when
a VPN connects and it has any underlying network (which
means almost always, because it will take the default
network if it doesn't declare any). Fixing this was
necessary to have a cogent test of this issue, but it
could be moved to another patch or it could stay unfixed
with some minor ajustment to the tests if judged too
dangerous to include in R at this point.

Test: New tests in this patch. Also manually tested with
      tcpdump as described in b/150570873.
Bug: 150570873
Change-Id: I3e4ff990c0d4825b21c7679be29a482a2d1324ec
2020-05-11 10:44:50 +09:00
Remi NGUYEN VAN
c9f24746f2 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
Change-Id: Ifd4e9c02a6b9a2b2b8b254fc4da7bfb9e0a84550
2020-05-10 16:11:11 +09:00
Chalard Jean
4726fe863c Merge "Fix a bug where a spurious capabilities callback is sent." am: 0d4995dcb7
Change-Id: Ide91b1e5ce2fe17dd6c6b46644e0d30b47660b2f
2020-05-08 01:14:37 +00:00
Chalard Jean
0d4995dcb7 Merge "Fix a bug where a spurious capabilities callback is sent." 2020-05-08 00:49:33 +00:00
Sarah Chin
5581c36ff3 Merge "Added a new capability for temporarily unmetered network." am: c5c7994da9
Change-Id: I94eb37627875f96c7e70a5df9d273266bc4def66
2020-05-07 06:01:20 +00:00
Chalard Jean
d568791283 Fix a bug where a spurious capabilities callback is sent.
When a VPN connects and it has any underlying network (which
means almost always, because it will take the default network
if it doesn't declare any), it has default capabilities and
will only take the capabilities of its underlying network
as part of an update happening after making the network
available but before the rematch can take place. This in turn
causes the capabilities callback sent as part of the rematch
to be spuriously sent.

Test: FrameworksNetTests. Also tested together with a
      followup that adds tests with drive-by coverage for this.
Bug: 150570873
Change-Id: Id7d8bba486bada1a7ba5b0f152d2aa02e407f249
2020-05-07 12:07:03 +09:00
Jack Yu
0298306ba0 Added a new capability for temporarily unmetered network.
Added a new network capability TEMOPORARILY_NOT_METERED to support
the case that a network can temporarily become unmetered. This
allows carriers to deploy unmetered 5G network. When devices
camp on 5G network, this capability will be dynamically added
to the network and will be removed once leaving 5G coverage.

Bug: 153081494
Test: Manual
Change-Id: I10e26cb0852e67f614e7b9c4e49f95e078602e21
Merged-In: I10e26cb0852e67f614e7b9c4e49f95e078602e21
2020-05-06 13:13:45 -07:00
Treehugger Robot
7e92e7330c Merge "[SM10] Adopt helper class to monitor RAT type change per sub" am: f4a8f1f21e
Change-Id: Ifadf4ad62820c6cbf536a3984b1cf4a0b78cbc31
2020-05-05 11:32:31 +00:00
junyulai
d33735c952 [SM10] Adopt helper class to monitor RAT type change per sub
Test: atest NetworkStatsServiceTest
Bug: 146415925
Change-Id: I45c3aa9046b316c8cd0943543d620a22e4afefd1
Merged-In: I45c3aa9046b316c8cd0943543d620a22e4afefd1
(cherry picked from commit 219faff07bdc58c14fe58fc525e86383db1f8167)
2020-05-05 18:37:29 +08:00
Remi NGUYEN VAN
d04dcdcea0 Merge "Use the new NetworkStackConnector constructor" am: 062e45d48c
Change-Id: Ifaef8916460a4c3c275b9cdf20ee87b562a42785
2020-05-01 04:30:38 +00:00
Remi NGUYEN VAN
062e45d48c Merge "Use the new NetworkStackConnector constructor" 2020-05-01 04:19:29 +00:00
Rambo Wang
c00993f9c8 Merge "Rename satisfiedBy to canBeSatisfiedBy for MatchAllNetworkSpecifier" am: bf1206f8fa
Change-Id: Ia4f99dcf6c86a356c1490b6500dd5e5016ff7257
2020-04-30 15:19:24 +00:00
Rambo Wang
bf1206f8fa Merge "Rename satisfiedBy to canBeSatisfiedBy for MatchAllNetworkSpecifier" 2020-04-30 15:07:18 +00:00
Rambo Wang
f3508769ea Rename satisfiedBy to canBeSatisfiedBy for MatchAllNetworkSpecifier
MatchAllNetworkSpecifier is a subclass of NetworkSpecifer. The method
satisfiedBy should be renamed to canBeSatisfiedBy together with other
subclass of NetworkSpecifer in b/152238712.

Add annotation @Overide for the method to make sure it will not get
ignored when refactor in the future.

Bug: 154956584
Test: atest android.net.MatchAllNetworkSpecifierTest
Change-Id: Ibe32fd50fae43aa635c1c0dad66eaea82011c8b7
2020-04-30 15:06:35 +00:00
Chiachang Wang
098a24b8d4 Merge changes I3525edc3,I6e18915e am: 7752ddf0b7
Change-Id: Ie298cd37fdaa8d638298e8326c6f1db7a5d5b7b4
2020-04-29 09:08:45 +00:00
Chiachang Wang
7752ddf0b7 Merge changes I3525edc3,I6e18915e
* changes:
  Filter debug entries for each vpn
  Add test prefix into test cases
2020-04-29 08:43:02 +00:00
Chiachang Wang
1d5c290e38 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
2020-04-29 15:07:45 +08:00
Chiachang Wang
88fa813bd7 Add test prefix into test cases
Bug: 152678151
Test: atest com.android.server.net.NetworkStatsFactoryTest
Change-Id: I6e18915e383ac20072cb238d0136d7a8e4ceb811
2020-04-29 13:44:50 +08:00
Benedict Wong
a7c8c64284 Merge "Add filtering for IPsec algorithms in IKEv2 VPNs" am: eb8393aa09
Change-Id: Ib3e7bea4ad17eaf0b64bc157ed682c672a17f79a
2020-04-28 17:59:07 +00:00
Benedict Wong
eb8393aa09 Merge "Add filtering for IPsec algorithms in IKEv2 VPNs" 2020-04-28 17:33:46 +00:00
Remi NGUYEN VAN
a065d07edf Use the new NetworkStackConnector constructor
The constructor was changed to allow for unit tests.

Bug: 137328719
Test: atest FrameworksNetIntegrationTests
Change-Id: I46f247268310e12d420531745a22e93cf3550e89
2020-04-28 15:50:38 +09:00
Cody Kesting
f53a075913 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
2020-04-27 20:55:00 -07:00
Cody Kesting
fc7cad313d 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
2020-04-27 20:54:57 -07:00