Commit Graph

2131 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Chiachang Wang
d4a9e976e8 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
2020-04-13 08:58:48 +00:00
Chiachang Wang
210a4da6ed 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
Change-Id: Iddd00e1c85abe767b1a41a1761d3266ba322dba6
2020-04-13 08:13:04 +00:00
Lorenzo Colitti
d275ec139a Merge "Set transport types to resolver" 2020-04-13 07:03:20 +00:00
chenbruce
7b2f898a9a 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
Merged-In: I03fc5c62dfd9a51a78a720860531df282fdecc20
Change-Id: I6527cde0e177ba08c886576131b35fc769c2bb53
2020-04-11 23:00:13 +08: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
Hall Liu
24e6e442b7 Merge changes from topic "phonestatelistener-limit-rvc-dev"
* changes:
  Add gating, logging for PhoneStateListener's limit
  Institute limit on PhoneStateListener
2020-04-11 00:36:13 +00:00
lucaslin
311bd48fe8 Set WifiAwareNetworkInfo into setTransportInfo()
Bug: 139268426
Bug: 135998869
Bug: 138306002
Test: atest CtsNetTestCasesLatestSdk:NetworkCapabilitiesTest
Change-Id: Ibbe1cd126d6538003fbb1e5e85892bfb15a920e8
Merged-In: Ibbe1cd126d6538003fbb1e5e85892bfb15a920e8
2020-04-08 10:09:16 +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
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
69784419af Merge "Fix NetworkStatsApiTest failed on Q device" into rvc-dev 2020-04-08 05:55:57 +00:00
Junyu Lai
7ab8d925bf Fix NetworkStatsApiTest failed on Q device
Currently, the addEntry method is used in constructor of test,
which is not correct since there is no such method in Q devices.

Thus, initialize of NetworkStats variables outside of constructor.

Test: atest NetworkStatsApiTest
Test: atest CtsNetTestCasesLatestSdk:NetworkStatsApiTest on Q device
Bug: 150644692
Change-Id: Ibf2f8118c459a8d7a0992deca8f0f339ccd1bcea
Merged-In: Ibf2f8118c459a8d7a0992deca8f0f339ccd1bcea
(cherry picked from commit ae023a8bbd3a7482fd66547d58759c88e100f207)
2020-04-08 03:13:10 +00:00
Hall Liu
a85ea98c7a Add gating, logging for PhoneStateListener's limit
Add gating via PlatformCompat and DeviceConfig and logging via
PlatformCompat to the limit instituted on per-process listeners

Fixes: 152074216
Test: atest CtsTelephonyHostCases
Change-Id: I4d6681d90705b68c3349f4124e434a29b50fd3a2
Merged-In: I4d6681d90705b68c3349f4124e434a29b50fd3a2
2020-04-07 17:13:19 -07:00
Junyu Lai
b0104c84f8 Merge "Fix NetworkStatsApiTest failed on Q device" 2020-04-07 10:49:19 +00:00
Treehugger Robot
4aae1e23cf Add trivial dependencies tests for the network stack
Test: this
Bug: 153033018

Change-Id: I3e66752ebfb5f4324d897210ce26ddaf67f53228
Merged-In: Ie3c15ed25ef3088d3b9b650ffc7f34f49efa6b81
(cherry picked from commit c79353f2e4a99635bcf6eb9177c971f268f71204, aosp/1275998)
2020-04-07 10:09:10 +00:00
Treehugger Robot
7621ca16a3 Merge "Add trivial dependencies tests for the network stack" 2020-04-07 08:34:44 +00:00
junyulai
ff97691273 Fix NetworkStatsApiTest failed on Q device
Currently, the addEntry method is used in constructor of test,
which is not correct since there is no such method in Q devices.

Thus, initialize of NetworkStats variables outside of constructor.

Test: atest NetworkStatsApiTest
Test: atest CtsNetTestCasesLatestSdk:NetworkStatsApiTest on Q device
Bug: 150644692
Change-Id: Ibf2f8118c459a8d7a0992deca8f0f339ccd1bcea
2020-04-07 15:07:16 +08:00
Chalard Jean
77c7660522 Add trivial dependencies tests for the network stack
Test: this
Bug: 153033018
Change-Id: Ie3c15ed25ef3088d3b9b650ffc7f34f49efa6b81
2020-04-07 14:42:00 +09:00
lucaslin
3df2ebcb83 Add more tests in NetworkCapabilitiesTest.java
Test deduceRestrictedCapability(), getAdministratorUids(),
setAdministratorUids(), getNetworkSpecifier(), getOwnerUid(),
setLinkDownstreamBandwidthKbps(), setLinkUpstreamBandwidthKbps()
and setSignalStrength().

Bug: 139268426
Bug: 135998869
Bug: 138306002
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkCapabilitiesTest
Change-Id: I90c7a8c47710ea4ad8e8d2682c10440fd7f82270
2020-04-07 11:58:22 +08:00
Lorenzo Colitti
6c0cbccf96 Rename the *Nat64Prefix to *Nat64PrefixFromDns.
This just a rename with no functional changes at all. It is
preparation for supporting getting the NAT64 prefix from the
RA.

Bug: 150648313
Test: covered by existing ConnectivityServiceTest and Nat464XlatTest
Merged-In: Ia9a09a708870827b1e4cf068f930fa9542dd116c
Change-Id: Ia9a09a708870827b1e4cf068f930fa9542dd116c
2020-04-06 15:45:14 +00:00
Lucas Lin
5123e0509e Merge "Add MatchAllNetworkSpecifierTest" into rvc-dev 2020-04-06 09:35:27 +00:00
Junyu Lai
c6b106fbc1 Merge changes from topic "am-5ce58db354ac494a84904378ca35c013-rvc-dev" into rvc-dev
* changes:
  [SP26] add CTS for NetworkStats
  [SP26.2] add a method in NetworkStats that removes empty entries
2020-04-06 04:15:39 +00:00
Remi NGUYEN VAN
0b4ad3a9d5 Merge "Fix setAdministratorUids tests on Q" into rvc-dev 2020-04-06 02:22:37 +00:00
Junyu Lai
b80fe74899 [SP26] add CTS for NetworkStats
Test: atest NetworkStatsApiTest
Test: atest CtsNetTestCasesLatestSdk:NetworkStatsApiTest on Q device
Bug: 150644692
Change-Id: I690704b43cfd16de70c4c83916f6d750cf613f67
Merged-In: I690704b43cfd16de70c4c83916f6d750cf613f67
(cherry picked from commit 5c670a2714f3ed783b6d5245714d0039c8fd1e9c)
2020-04-06 02:21:17 +00:00
junyulai
56f59c493b [SP26.2] add a method in NetworkStats that removes empty entries
In current design, entries with zeros are preserved after
addition/subtraction. These entries are not very useful
and lead to difficulty of verifying the result of
addition/subtraction.

However, change the behavior in the original NetworkStats
is considered risky in current stage.

Thus, this change provide a function that could remove these
empty entries in tests.

Test: atest FrameworksNetTests
Bug: 152827872
Bug: 150644692

Change-Id: I40a76935d55712b8083ee1e17e137a8a4ef5e029
Merged-In: I40a76935d55712b8083ee1e17e137a8a4ef5e029
(cherry picked from commit 6c7bef3064dbe949b7b213036b8e70c125ddd343)
2020-04-06 02:18:50 +00:00
TreeHugger Robot
147d1574b1 Merge "Only apply VPN isolation if it's fully routed" into rvc-dev 2020-04-04 03:44:46 +00:00
Remi NGUYEN VAN
24260d5e6d Fix setAdministratorUids tests on Q
setAdministratorUids does not exist on Q, so such tests must be skipped
on Q devices.

Bug: 147903575
Test: atest CtsNetTestCasesLatestSdk on Q and AOSP devices
Merged-In: I1b362660de9733bb9f0ede1ed5cf62279bf1c05e
Change-Id: I1b362660de9733bb9f0ede1ed5cf62279bf1c05e
2020-04-03 09:42:33 +00:00
Remi NGUYEN VAN
7e3fc61cf1 Merge "Fix setAdministratorUids tests on Q" 2020-04-03 07:54:59 +00:00
Remi NGUYEN VAN
d8223ef5fc Merge "Make LinkPropertiesTest compatible with Q" into rvc-dev 2020-04-03 07:52:26 +00:00
Lorenzo Colitti
d523d1416d Rename the *Nat64Prefix to *Nat64PrefixFromDns.
This just a rename with no functional changes at all. It is
preparation for supporting getting the NAT64 prefix from the
RA.

Bug: 150648313
Test: covered by existing ConnectivityServiceTest and Nat464XlatTest
Change-Id: Ia9a09a708870827b1e4cf068f930fa9542dd116c
2020-04-02 22:48:03 +09:00
Lorenzo Colitti
7fb7c3e0bf Only apply VPN isolation if it's fully routed
VPN is considered fully routed if both IPv4 and IPv6 have
either a default route or a prohibit route.

Bug: 145332510
Test: atest FrameworksNetTests
Merged-In: I59cf48552bca98092d1212e3d718fd420add5458
Change-Id: I59cf48552bca98092d1212e3d718fd420add5458
2020-04-02 10:36:19 +00:00
Lorenzo Colitti
86ae134de8 Merge "Add more tests in LinkPropertiesTests.java" into rvc-dev 2020-04-02 10:35:49 +00:00
Chalard Jean
9122e56202 Merge changes from topics "api-fix-networkagent", "satisfiedby"
* changes:
  Rename satisfiedBy into canBeSatisfiedBy
  Address further API council comments.
2020-04-02 05:51:02 +00:00
Remi NGUYEN VAN
824f80b129 Fix setAdministratorUids tests on Q
setAdministratorUids does not exist on Q, so such tests must be skipped
on Q devices.

Bug: 147903575
Test: atest CtsNetTestCasesLatestSdk on Q and AOSP devices
Change-Id: I1b362660de9733bb9f0ede1ed5cf62279bf1c05e
2020-04-02 13:58:03 +09:00
Lorenzo Colitti
5c5d1a1282 Merge "Only apply VPN isolation if it's fully routed" 2020-04-02 04:10:12 +00:00
Aaron Huang
ccd5ba288a Make LinkPropertiesTest compatible with Q
CompareResult had been moved from LinkProperties to LinkPropertiesUtils
so this change ignores testCompareResult() on Q and only check
compareAllRoutes() works while android version is at least R.

Bug: 151782584
Test: atest CtsNetTestCasesLatestSdk:LinkPropertiesTest
Merged-In: I38b0d83abf983b3bcc01fc6aea2e5cc307734198
Change-Id: I38b0d83abf983b3bcc01fc6aea2e5cc307734198
2020-04-02 03:30:49 +00:00
Junyu Lai
e71d3cf971 Merge changes from topic "sp26-networkstats-cts"
* changes:
  [SP26] add CTS for NetworkStats
  [SP26.2] add a method in NetworkStats that removes empty entries
2020-04-02 02:00:59 +00:00
Chalard Jean
c62f9a53d8 Rename satisfiedBy into canBeSatisfiedBy
Test: FrameworksNetTests NetworkStackTests
Bug: 152238712
Change-Id: I076876a6662bde143ef7d315ce3767acafff93c1
Merged-In: I076876a6662bde143ef7d315ce3767acafff93c1
2020-04-01 20:38:30 +08:00
junyulai
e47c7e42e5 [SP26] add CTS for NetworkStats
Test: atest NetworkStatsApiTest
Test: atest CtsNetTestCasesLatestSdk:NetworkStatsApiTest on Q device
Bug: 150644692
Change-Id: I690704b43cfd16de70c4c83916f6d750cf613f67
2020-04-01 16:46:08 +08:00
junyulai
1052557f33 [SP26.2] add a method in NetworkStats that removes empty entries
In current design, entries with zeros are preserved after
addition/subtraction. These entries are not very useful
and lead to difficulty of verifying the result of
addition/subtraction.

However, change the behavior in the original NetworkStats
is considered risky in current stage.

Thus, this change provide a function that could remove these
empty entries in tests.

Test: atest FrameworksNetTests
Bug: 152827872
Bug: 150644692
Change-Id: I40a76935d55712b8083ee1e17e137a8a4ef5e029
2020-04-01 16:46:08 +08:00