Commit Graph

8887 Commits

Author SHA1 Message Date
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
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
Bruce Chen
22c40575a1 Merge "Add testTransportTypesEqual to dnsmanager test cases" into rvc-dev am: 60afb5ab62
Change-Id: I652f7383c805d0f5fc2274a731f8267336da53ec
2020-04-17 08:30:46 +00:00
Bruce Chen
60afb5ab62 Merge "Add testTransportTypesEqual to dnsmanager test cases" into rvc-dev 2020-04-17 08:25:23 +00:00
Lorenzo Colitti
68b7413eeb Merge "Support changing the NAT64 prefix without removing it." into rvc-dev am: 6f2a54e75e
Change-Id: Id40e2345fceb28434ff612267c0fefb57a85898d
2020-04-17 07:28:32 +00:00
Lorenzo Colitti
59cdea7585 Merge "Add a function to process LinkProperties coming from an agent." into rvc-dev am: 448beb4c26
Change-Id: I69373207be56e00686ce0a789c94104e481c00da
2020-04-17 07:28:10 +00:00
Lorenzo Colitti
6f2a54e75e Merge "Support changing the NAT64 prefix without removing it." into rvc-dev 2020-04-17 07:26:08 +00:00
Bruce Chen
4e54d05cbc 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
Merged-In: I6b23ccc6ce1659fdfd9573dfcd895f2c20fa9417
Change-Id: I3dd4ed0d1fcceca9c8aec9b3e6769603e4fa913b
(cherry picked from commit 5f28e6f881e0ea52e8e96c1207654ce44b0d05a1)
2020-04-17 05:25:31 +00:00
Lorenzo Colitti
5559f1edd9 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
Merged-In: Ibeeb5f79e8afd3350c935934713d7882f2e0281f
Change-Id: Ibeeb5f79e8afd3350c935934713d7882f2e0281f
2020-04-17 04:43:06 +00:00
Lorenzo Colitti
aa0c7d00cf 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
Merged-In: I789fe9d46d3ac5d074ae697d23013f24a9e0246d
Change-Id: I789fe9d46d3ac5d074ae697d23013f24a9e0246d
2020-04-17 04:37:26 +00:00
Junyu Lai
2ae015277e Merge "[SM10] Adopt helper class to monitor RAT type change per sub" into rvc-dev am: dd44555083
Change-Id: I6cfb8d5a6d1306200d63afa6770df89472bd2f81
2020-04-15 17:26:05 +00:00
Junyu Lai
a9a966c265 Merge "[SP27.3] Rename TestableNetworkStatsProvider" into rvc-dev am: 3db3e009be
Change-Id: I5f1820bc4487bea25b75e1b82365d6833372b0c3
2020-04-15 17:25:21 +00:00
Junyu Lai
dd44555083 Merge "[SM10] Adopt helper class to monitor RAT type change per sub" into rvc-dev 2020-04-15 11:49:01 +00:00
Junyu Lai
3db3e009be Merge "[SP27.3] Rename TestableNetworkStatsProvider" into rvc-dev 2020-04-15 10:44:23 +00:00
junyulai
c6081f9c50 [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-04-15 10:30:49 +00:00
Chalard Jean
1021a87273 Merge "Add instrumentation to test NetworkAgent." into rvc-dev am: 008a54b355
Change-Id: Iadbfaa4dff8effc6c7ece6fd6f3af1a1dc58b7c0
2020-04-14 05:12:48 +00:00
Chalard Jean
008a54b355 Merge "Add instrumentation to test NetworkAgent." into rvc-dev 2020-04-14 04:54:33 +00:00
Chalard Jean
433c8ff695 Merge "Allow testing of signal strength" into rvc-dev am: 4947356664
Change-Id: If926a556bfe9e016254d427a78fa6061e9d2d6e0
2020-04-14 02:52:03 +00:00
Chalard Jean
0e9a7738d0 Allow testing of signal strength
- Let any process with NETWORK_SETTINGS register for signal strength
  wakeup.
- Allow agents registering test networks to assign them a signal
  strength.

Test: NetworkAgentTest
Bug: 139268426
Change-Id: Iebfeb9316bcbd8472459c517abb16f1f9d879871
Merged-In: I2b4b89be3e69f4853fd6978d2c8f5c8eb4271f21
(cherry picked from commit 5cc7b18fe7fa94ce2e30572c476df445ed337741, aosp/1284585)
2020-04-14 01:22:14 +00:00
Chiachang Wang
3e58ebdaad Merge "Add more tests for CaptivePortalData" into rvc-dev am: ecbf648b62
Change-Id: I68bf2166d3fafbcab03ec17ea5f134209798e242
2020-04-14 01:21:59 +00:00
Chiachang Wang
a82d1a814a Merge "Move CaptivePortalDataTest to common test to support cts" into rvc-dev am: 7448287450
Change-Id: I56149a0d137fa346affd22278a7fbfecbb7b0643
2020-04-14 01:21:16 +00:00
Chalard Jean
e770137062 Add instrumentation to test NetworkAgent.
Test: NetworkAgentTest, new tests using this API
Bug: 139268426
Change-Id: I0b65be788bb742fd1a8c0ca624e97368462f9b6a
Merged-In: Ia83b1c896df63bb18e2aa4b74d6cc09eba990eb5
(cherry picked from commit d89dcb9765b9c73c950661faaf8af9b795934acb, aosp/1284574)
2020-04-14 01:20:16 +00:00
Chiachang Wang
424cced078 Add more tests for CaptivePortalData
Add missing tests to cover all system APIs

Bug: 152280218
Bug: 150640683
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalDataTest on
      both Q and R device
Change-Id: I6d3826922f16816d5b18ed3540266442a0ed3e49
Merged-In: I6d3826922f16816d5b18ed3540266442a0ed3e49
(cherry picked from commit d9f9bf34637f699608fa3b919b3c85f3d5514a83)
2020-04-14 01:13:21 +00:00
Chiachang Wang
3acd429ba3 Move CaptivePortalDataTest to common test to support cts
Commit has to on top of aosp/1281921 to skip whole test in Q
device since CaptivePortalData class is introduced in R.

Result in Q will be:
[1/1] android.net.CaptivePortalDataTest#skippedClassForDevSdkMismatch: IGNORED

Bug: 152280218
Bug: 150640683
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalDataTest on
      both Q and R device
Merged-In: Iddd00e1c85abe767b1a41a1761d3266ba322dba6
Change-Id: Iddd00e1c85abe767b1a41a1761d3266ba322dba6
2020-04-13 12:50:01 +00:00
TreeHugger Robot
45160bca9f Merge "Set transport types to resolver" into rvc-dev am: a6182bb9da
Change-Id: I0ee02778a7e2a5bf54ec73edf34fe1a4d98c6ebe
2020-04-11 14:41:01 +00:00
TreeHugger Robot
a6182bb9da Merge "Set transport types to resolver" into rvc-dev 2020-04-11 14:25:27 +00:00
chenbruce
db2aad69ed Set transport types to resolver
For a given network, resolver doesn't know what transport types are.
Therefore, when a new network is created or transport types are changed
in a give network, transport types will be updated and sent by calling
setResolverConfiguration(). In the same time, if link properties or
transport types are null, setResolverConfiguration() won't be called.
The original behaviors of setResolverConfiguration() aren't changed.
Only increasing one new behavior that when a given network has transport
type change, calling setResolverConfiguration() directly and resolver
updates the transport types for that given network.

Bug: 143732914
Test: atest FrameworksNetTests
      atest FrameworksNetIntegrationTests
Change-Id: I6527cde0e177ba08c886576131b35fc769c2bb53
2020-04-11 14:39:59 +08:00
Chalard Jean
dbcce5454b Merge "Fix a theoretical NPE" into rvc-dev am: ce6aa16b80
Change-Id: I82c5df71163bfe14a5d0eb6b8fb3628cb67defb6
2020-04-11 05:16:38 +00:00
Treehugger Robot
b9db69f623 Fix a theoretical NPE
Test: NetworkAgentTests
Bug: 153718627

Change-Id: I955b6dac6de48b12696dc640f131f5983ac552df
Merged-In: I08f57cce0cd85d5cd66e9a0ef948224290e9200e
(cherry picked from commit 31492c708746a51f70c74913a4d6cd97bf06ae63, aosp/1284575)
2020-04-11 03:26:27 +00:00
TreeHugger Robot
082a9f45bf Merge "Set WifiAwareNetworkInfo into setTransportInfo()" into rvc-dev am: d8a5511b92
Change-Id: Ib40ba2aeb8ed06e4d91a74cf8261af0f5eac2a66
2020-04-08 09:59:54 +00:00
junyulai
09d50fe69d [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
2020-04-08 17:36:45 +08:00
lucaslin
ec5e7af977 Set WifiAwareNetworkInfo into setTransportInfo()
Bug: 139268426
Bug: 135998869
Bug: 138306002
Test: atest CtsNetTestCasesLatestSdk:NetworkCapabilitiesTest
Change-Id: Ibbe1cd126d6538003fbb1e5e85892bfb15a920e8
2020-04-08 08:11:10 +00:00
Lucas Lin
24692c2351 Merge "Add more tests in NetworkCapabilitiesTest.java" into rvc-dev am: 37fbb256e8
Change-Id: Iffc785851bd1f84d54ef067ef8e555ba57587b2c
2020-04-08 07:53:43 +00:00
Lucas Lin
37fbb256e8 Merge "Add more tests in NetworkCapabilitiesTest.java" into rvc-dev 2020-04-08 07:40:30 +00:00
lucaslin
c12fcce03c Add more tests in NetworkCapabilitiesTest.java
Test deduceRestrictedCapability(), getAdministratorUids(),
setAdministratorUids(), getNetworkSpecifier(), getOwnerUid(),
setLinkDownstreamBandwidthKbps(), setLinkUpstreamBandwidthKbps(),
setSignalStrength() and Builder().

Bug: 139268426
Bug: 135998869
Bug: 138306002
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkCapabilitiesTest
Change-Id: I525941c47b71cd61ee872fd4d71b02a5d3767e21
Merged-In: I90c7a8c47710ea4ad8e8d2682c10440fd7f82270
2020-04-08 07:37:49 +00:00
Junyu Lai
4d73db7f19 Merge "Fix NetworkStatsApiTest failed on Q device" into rvc-dev am: 69784419af
Change-Id: I7bc25a66b6d1c50c29ea7810d0ec02f6c783e0b6
2020-04-08 05:56:49 +00:00
Junyu Lai
69784419af Merge "Fix NetworkStatsApiTest failed on Q device" into rvc-dev 2020-04-08 05:55:57 +00:00