Commit Graph

8592 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
c7276dea28 Merge "Add comment / logging in NetworkMonitor callbacks" am: 34e9cb2fdc
Change-Id: I8ba92e70462735961ae260234fc53f39e71994c5
2020-04-27 07:56:55 +00:00
Remi NGUYEN VAN
34e9cb2fdc Merge "Add comment / logging in NetworkMonitor callbacks" 2020-04-27 07:26:25 +00:00
Benedict Wong
aed6b6ff17 Merge "Add tests for Tunnel, Transport mode application with released SPIs" am: 27a2f1dff8
Change-Id: I60b9f6f52ba6aa64e6329f15ef1529b52c8a1b6a
2020-04-24 23:12:31 +00:00
Benedict Wong
fc7ba96b15 Merge "Use TransformRecord to get SPI instead of SpiRecord" am: 88c8a19311
Change-Id: If9d23537009ea1359d7dc198ba4662c85f8f4b0c
2020-04-24 23:12:27 +00:00
Benedict Wong
27a2f1dff8 Merge "Add tests for Tunnel, Transport mode application with released SPIs" 2020-04-24 22:32:41 +00:00
Benedict Wong
88c8a19311 Merge "Use TransformRecord to get SPI instead of SpiRecord" 2020-04-24 22:32:41 +00:00
Remi NGUYEN VAN
e468a26c7a Merge "Address comments on NetworkStack AIDL v6" am: 0e93810453
Change-Id: I755d14877a65b359c0837cab1488875d7238440e
2020-04-24 12:04:38 +00:00
Remi NGUYEN VAN
455b93d137 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
Change-Id: I2dbfc9bf7b2f785ea4594851bd354e9fd0fc0bd1
2020-04-24 20:56:39 +09:00
Remi NGUYEN VAN
0e93810453 Merge "Address comments on NetworkStack AIDL v6" 2020-04-24 11:56:32 +00:00
Remi NGUYEN VAN
9b647ca69a 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
Change-Id: Id9b71784e5f6294d203230e57737979e063ff0f8
2020-04-24 18:52:02 +09:00
Treehugger Robot
1a01782799 Merge "Add test for NetworkSpecifier" am: 93c21fc7b5
Change-Id: I04cc2a0aad319e4266253267cacaecb517ec6efc
2020-04-23 14:31:52 +00:00
Treehugger Robot
93c21fc7b5 Merge "Add test for NetworkSpecifier" 2020-04-23 14:12:37 +00:00
Chiachang Wang
de4a675836 Add test for NetworkSpecifier
Tests for canBeSatisfiedBy() and redact()

Bug: 154686765
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkSpecifierTest
Change-Id: Iade6a5b355b8812a5eb191345dfe393938ee272c
2020-04-23 18:03:16 +08:00
Philip P. Moltmann
7b3866f284 Merge "Set attributionTag for noteOp(WRITE_SETTINGS) calls" am: da8697a48b
Change-Id: I3ddd8954cf8443f549f7965cc43f2600bf92a80b
2020-04-22 15:09:28 +00:00
Philip P. Moltmann
7bc33dfb89 Set attributionTag for noteOp(WRITE_SETTINGS) calls
Test: atest FrameworksNetTests TetheringTests:TetheringServiceTest
Bug: 136595429
Merged-In: I33f787644c44d7b0e5ce17a433820cfcd985cdfb
Change-Id: Ic3d937e7bb5141798234ed5b2852c1f768e97495
2020-04-20 18:00:03 -07:00
Lorenzo Colitti
d0359ea573 Merge "Stop prefix discovery if an RA prefix arrives in DISCOVERING" am: c44ca579ad
Change-Id: Ia51addeb9d1f954a396764ec049213ac216b7c1f
2020-04-20 11:21:47 +00:00
Lorenzo Colitti
3da6384b41 Merge "Make the Nat464Xlat tests more realistic." am: 6ce7a2aeee
Change-Id: I6a611b7fd7199d8c91baca39e04749ad8852a42e
2020-04-20 11:21:17 +00:00
Lorenzo Colitti
a00f03dd61 Merge "Support learning the NAT64 prefix from two different sources." am: 204b31920f
Change-Id: I8778773dab5f46aec6bf18c83d9766687307ca25
2020-04-20 11:20:58 +00:00
Lorenzo Colitti
c44ca579ad Merge "Stop prefix discovery if an RA prefix arrives in DISCOVERING" 2020-04-20 11:10:31 +00:00
Lorenzo Colitti
6ce7a2aeee Merge "Make the Nat464Xlat tests more realistic." 2020-04-20 11:06:08 +00:00
Lorenzo Colitti
204b31920f Merge "Support learning the NAT64 prefix from two different sources." 2020-04-20 11:05:52 +00:00
Lorenzo Colitti
38c6519a90 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
2020-04-20 17:54:20 +09:00
Lorenzo Colitti
c6bd5847c9 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
2020-04-20 17:54:20 +09:00
Lorenzo Colitti
e2eade021a 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
Change-Id: Ic7452431d2d9aea1ae59b67a9d8383c6cc5b3902
2020-04-20 16:50:53 +09:00
Aaron Huang
15a2eae782 Merge "Add network agent to enhance NetworkProvider test" am: 147d253956
Change-Id: Ib1b65aec6398f4e6a1cc2e14ec86d669be88ab74
2020-04-20 07:41:36 +00:00
Aaron Huang
147d253956 Merge "Add network agent to enhance NetworkProvider test" 2020-04-20 07:20:25 +00:00
Aaron Huang
54e05b5d08 Merge "Move DhcpInfoTest to frameworks/base/tests/net/common" am: e66ba51271
Change-Id: I7179f2e312d1e8237b211cb60eee5c08cd759197
2020-04-17 14:54:34 +00:00
Aaron Huang
82948ddb1c 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: I42a965ae5cb748fdd80b4d5c0f8b26f36f74be72
2020-04-17 18:26:20 +08:00
Aaron Huang
8d2f514530 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: Id494a1697cc1b73e8e56ae585a69faec31c59f52
2020-04-17 17:26:07 +08:00
Aaron Huang
29d37fd0e9 Merge changes from topic "cts-networkprovider" am: ab8282eea7
Change-Id: I3e86ba642bc86bb25dc45ef65328c014962c95db
2020-04-17 04:22:29 +00:00
Aaron Huang
ab8282eea7 Merge changes from topic "cts-networkprovider"
* changes:
  Add cts test for NetworkProvider
  Adjust permission of NetworkProvider related API
2020-04-17 03:59:47 +00:00
Bruce Chen
fe5c71b37f Merge "Add testTransportTypesEqual to dnsmanager test cases" am: 0e97073a4d
Change-Id: Idae99c5d19fcffdaf568b79aaa3e1679347ea655
2020-04-17 03:23:18 +00:00
Bruce Chen
0e97073a4d Merge "Add testTransportTypesEqual to dnsmanager test cases" 2020-04-17 02:59:15 +00:00
Junyu Lai
acaac38457 Merge "[SP27.3] Rename TestableNetworkStatsProvider" am: 9151f7c748
Change-Id: If3f447e3029c3ccb9a21e00257f596dd690ef55a
2020-04-17 02:26:28 +00:00
Junyu Lai
9151f7c748 Merge "[SP27.3] Rename TestableNetworkStatsProvider" 2020-04-17 02:24:55 +00:00
Lorenzo Colitti
a77da57421 Merge "Add a function to process LinkProperties coming from an agent." am: 4cba5a3981
Change-Id: I7691b297b27065018e79b1808e35f9a02104a150
2020-04-16 16:38:01 +00:00
Lorenzo Colitti
3813daab0b Merge "Support changing the NAT64 prefix without removing it." am: f09bc1734f
Change-Id: I2616aba51bdad9afa2dddf6011355f14e4b5457e
2020-04-16 16:37:08 +00:00
Lorenzo Colitti
4cba5a3981 Merge "Add a function to process LinkProperties coming from an agent." 2020-04-16 16:25:29 +00:00
Lorenzo Colitti
f09bc1734f Merge "Support changing the NAT64 prefix without removing it." 2020-04-16 16:24:57 +00:00
chenbruce
01950be123 Add testTransportTypesEqual to dnsmanager test cases
A test that ensures that NetworkCapabilities.TRANSPORT_* is eaual
to IDnsResolver.TRANSPORT_* for every possible value of each.

Bug: 153267602
Test: atest FrameworksNetTests
Change-Id: I6b23ccc6ce1659fdfd9573dfcd895f2c20fa9417
2020-04-16 18:04:16 +08:00
Lorenzo Colitti
18a58468c4 Add a function to process LinkProperties coming from an agent.
There are tasks that need to be performed when receiving
LinkProperties directly from a NetworkAgent (either at
registration time or in subsequent updates).

Currently, the only example of such a task is calling
ensureDirectlyConnectedRoutes. This is currently done in
handleUpdateLinkProperties, which is often unnecessary,
because that method iscalled in many other cases than when
receiving properties directly from an agent. Ensuring directly
connected routes only needs to be done when receiving
LinkProperties from the agent, because ConnectivityService does
not directly manipulate routes.

This CL does not do much except remove these superfluous calls
and add the method. A future CL will add more code to the method.

Bug: 150648313
Test: atest ConnectivityServiceTest
Change-Id: Ibeeb5f79e8afd3350c935934713d7882f2e0281f
2020-04-16 16:23:07 +09:00
Aaron Huang
2bb072d54c 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 CtsNetTestCasesLatestSdk:android.net.NetworkProviderTest
Change-Id: If7bfc7fae503e3497c37754697d0b148ff4cab3b
2020-04-16 06:40:20 +00:00
Aaron Huang
ebbfd3ccb9 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.

Bug: 153612373
Bug: 153614605
Test: atest FrameworksNetTests
      atest CtsNetTestCases:android.net.NetworkProviderTest
Change-Id: Ic9809e731aa811a51c2f82d189372169d99a5ed9
2020-04-16 14:03:55 +08:00
Lorenzo Colitti
7f3d684631 Support changing the NAT64 prefix without removing it.
This cannot (currently) happen with DNS64 detection, but it can
happen with the PREF64 option.

Bug: 150648313
Test: atest ConnectivityServiceTest Nat464XlatTest --rerun-until-failure 100
Change-Id: I789fe9d46d3ac5d074ae697d23013f24a9e0246d
2020-04-16 00:07:30 +09:00
junyulai
d8d7916d95 [SP27.3] Rename TestableNetworkStatsProvider
Currently, TestableNetworkStatsProvider is a subclass of
INetworkStatsProvider. This is not very accurate naming after
API council review feedback since now we have
NetworkStatsProvider as a system api interface.

This is the counter-part change of actual renaming CL in
NetworkStack.

Test: atest FrameworksNetTests TetheringTests
Bug: 150643374
Change-Id: Ifa8175dc4e2fe2b907ec13b3bd2eca12974f5ea7
Merged-In: Ifa8175dc4e2fe2b907ec13b3bd2eca12974f5ea7
(cherry-picked from ag/10976522)
2020-04-15 19:01:13 +08:00
Benedict Wong
8e3914c162 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
2020-04-14 18:07:36 -07:00
Chalard Jean
926dbce337 Merge "Allow testing of signal strength" am: 836df36aee
Change-Id: I2300fe5c9be8a781fea67358c5e1774872b29f7c
2020-04-13 17:32:30 +00:00
Chalard Jean
836df36aee Merge "Allow testing of signal strength" 2020-04-13 17:27:06 +00:00
Chalard Jean
6dcb6a943c Merge "Add instrumentation to test NetworkAgent." am: eb1d6593c5
Change-Id: I799ad6fa5d6f1bf522414081bac75c952ad2baf7
2020-04-13 15:05:03 +00:00
Chalard Jean
eb1d6593c5 Merge "Add instrumentation to test NetworkAgent." 2020-04-13 14:47:58 +00:00