Commit Graph

4468 Commits

Author SHA1 Message Date
James Mattis
e94dfe7f49 Merge "CTS tests for EthernetNetworkSpecifier" am: 700774f34e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1973286

Change-Id: I63f1afbb659abf3a2945ca4840cf85ea9dd9d882
2022-02-17 03:28:35 +00:00
James Mattis
700774f34e Merge "CTS tests for EthernetNetworkSpecifier" 2022-02-17 03:10:36 +00:00
James Mattis
deaeefb283 CTS tests for EthernetNetworkSpecifier
Bug: 210485380
Test: atest CtsNetTestCasesLatestSdk
:android.net.cts.EthernetNetworkSpecifierTest

Change-Id: I080bc111aa57c7889a6bf9564b8fc2c1dddd944d
2022-02-16 16:46:49 -08:00
Patrick Rohr
a0f346958f Merge "Fix NetworkStatsServiceTest after adding deleteKernelTagData" am: 3226bfb631
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1968682

Change-Id: I26bc260ae6727e4e7d1a6053851681e0cee48631
2022-02-16 20:35:23 +00:00
Patrick Rohr
3226bfb631 Merge "Fix NetworkStatsServiceTest after adding deleteKernelTagData" 2022-02-16 19:59:14 +00:00
Maciej Żenczykowski
058463a731 Merge "Skip BpfExistenceTest#TestPrograms on BPF unsupported device" am: 7d30b56f06
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1987626

Change-Id: Icd154fbacbd5a48cd884ce5488bd01d922967d69
2022-02-16 12:57:56 +00:00
Remi NGUYEN VAN
e4455f91f7 Fix testing with/without connectivity module am: 3b81323e4a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1987446

Change-Id: I47ec700b2ffb852a74ec5fea0640ea95e3e223fd
2022-02-16 12:57:00 +00:00
Remi NGUYEN VAN
73da478927 Cleanup and refine connectivity test config
Remove the include for Connectivity/Tethering TEST_MAPPING as there is
no such file in that directory, add comments on ConnectivityModuleTest
usage, and skip the whole NetworkAgentTest on non-connectivity module
MTS runs.

Bug: 218611855
Test: atest CtsNetTestCasesLatestSdk
Change-Id: Id96ab8a5ae631b0c64f20faedd4a0430eb9318d4
2022-02-16 20:34:31 +09:00
Maciej Żenczykowski
7d30b56f06 Merge "Skip BpfExistenceTest#TestPrograms on BPF unsupported device" 2022-02-16 11:22:47 +00:00
Hungming Chen
0456900bf2 Skip BpfExistenceTest#TestPrograms on BPF unsupported device
BPF is supported after kernel 4.9. Skip the test on BPF
unsupported device. Ex: walleye.

Bug: 219696135
Test: atest bpf_existence_test on walleye
Change-Id: I583a858587c0501582c9e77c8b584b3136312cd5
2022-02-16 16:06:59 +08:00
Patrick Rohr
f9888898e3 Add tests for deleteKernelTagData
Test: atest NetworkStatsServiceTest
Change-Id: I6db6b79314868271f877acf2a0b21699cbf02df5
2022-02-16 14:23:30 +08:00
Remi NGUYEN VAN
3b81323e4a Fix testing with/without connectivity module
Add missing @ConnectivityModuleTest annotations to tests that cover
functionalities that were introduced in a newer connectivity module
update.

Also add CtsNetTestCasesLatestSdk to postsubmit with only APK modules
installed, and with only the connectivity/tethering module installed.
This can then be moved to presubmit to catch such issues before they are
merged.

While doing this cleanup the TEST_MAPPING file in tests/ and merge its
contents into the root TEST_MAPPING file. This does not change anything
for "postsubmit" tests as they are run independently of changes. It only
causes FrameworksNetIntegrationTests to run in presubmit on any change
in modules/Connectivity/ instead of only on modules/Connectivity/tests/
changes, which is how it should be.

Bug: 218611855
Test: TH needs to test TEST_MAPPING
Change-Id: I26629a35d8c2df3db33180ecc22d49d538ad3b8b
2022-02-16 15:22:30 +09:00
Patrick Rohr
7c52b69b3e Fix NetworkStatsServiceTest after adding deleteKernelTagData
Test: atest NetworkStatsServiceTest
Change-Id: I667a5d86e0df8505fef549e598f3b4141637fb90
2022-02-16 14:01:29 +08:00
Tyler Wear
c2926f45f2 DscpPolicyTest Check Kernel Version
Check kernel version to ensure current kernel supports
BPF logic for testcase.

Bug: 217209172
Test: atest DscpPolicyTest
Change-Id: I9e0df7d2e4eb320bd5324e2d13410bd960b75174
2022-02-16 04:53:19 +00:00
Taras Antoshchuk
7bd33a19c3 Fix HostsideVpnTests flakyness
VpnTest#checkTrafficOnVpn tests whether IP address is on VPN by
sending udp packet, ping and tcp packet to the address.
In aosp/1941233 the order of checks was changed from udp, ping, tcp
to udp, tcp, ping, which caused flaky behavior of the method.

This CL restores the order of checks as it was prior to aosp/1941233.

Bug: 214558556
Bug: 215903863
Bug: 214398658
Test: atest HostsideVpnTests --iterations 50
Change-Id: I5dc3c217b78746d5e8c13b80e5295eb6ffe5b778
2022-02-15 09:14:33 +00:00
Taras Antoshchuk
0817bb2906 Fix HostsideVpnTest#testExcludedRoutes
One of VpnTest#startVpn overloads didn't propagate "excludedRoutes"
param, due to mistake during conflict resolution in aosp/1941233.

Bug: 214398350
Test: atest HostsideVpnTests --iterations
Change-Id: Icbbe7394f1ff1f676cc671a1fa1c4449f4d585e3
2022-02-15 09:14:03 +00:00
Xin Li
bfa7b1a197 Merge "Merge sc-v2-dev-plus-aosp-without-vendor@8084891" into stage-aosp-master 2022-02-14 17:31:19 +00:00
Remi NGUYEN VAN
106569b856 Merge "Allow test+other networks to have specifiers" 2022-02-14 05:31:20 +00:00
Jean Chalard
d537aa42e1 Merge "Add new methods to redact NetworkCapabilities & LinkProperties" 2022-02-12 11:56:36 +00:00
lucaslin
c582d50b8e Add new methods to redact NetworkCapabilities & LinkProperties
Some system components like VPN need to know how to redact
NetworkCapabilities & LinkProperties that they received from
the system but need to send to third-party applications with
less privilege than themselves. To make sure the redaction is
consistent, expose system API methods to do it that are wired
to the same redaction code used by ConnectivityService.

Bug: 191413541
Test: atest CtsNetTestCases, which includes new CTS for these
Change-Id: Ia3ae4755b5192884c147d6828f96cedac000a25b
2022-02-12 15:21:13 +09:00
Treehugger Robot
5be94579d4 Merge "Refer to SDK constant defined in DevSdkIgnoreRule" 2022-02-11 09:23:02 +00:00
Chiachang Wang
137bbed860 Refer to SDK constant defined in DevSdkIgnoreRule
Refer to the same constant definition as other tests instead of
hard coding locally, so that it won't be missed as changing to
Build.VERSION_CODES.SC_V2.

Bug: 184750836
Test: atest FrameworksNetTests
Change-Id: I3c17c414d830af03e2719c5dab1a664c55f6df2a
2022-02-11 07:40:58 +00:00
Xin Li
a459e6a12d Merge sc-v2-dev-plus-aosp-without-vendor@8084891
Bug: 214455710
Merged-In: I5894450f3089b2ea105722a18ddf8f1eed1c28a0
Change-Id: If2045705da821c90705f7dd1e6944c0bb92e3289
2022-02-11 06:57:49 +00:00
Treehugger Robot
0fc2ec6d68 Merge "remove unneeded inclusions of libbpf_android" 2022-02-10 19:50:34 +00:00
Robert Horvath
3a33495992 Merge "Add Low Power Standby test to NetworkManagementServiceTest" 2022-02-10 11:17:44 +00:00
Maciej Żenczykowski
11ab996252 remove unneeded inclusions of libbpf_android
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I6aedf507e09effd9076de85a0acc7aaf1b8e4a1e
2022-02-09 22:10:22 -08:00
Chiachang Wang
84ad04f768 Merge "Change naming of excludeLocalRoutes" 2022-02-10 00:50:30 +00:00
Patrick Rohr
6b5b7b40d8 Merge changes from topic "bandwidth-limiting"
* changes:
  Add bandwidth limiting to CS
  Add setting that controls network rate limit
2022-02-09 18:00:04 +00:00
Jean Chalard
ec05b337aa Merge "Pass the NetworkAgentConfig to NetworkMonitor." 2022-02-09 16:55:59 +00:00
Patrick Rohr
2857ac4dd0 Add bandwidth limiting to CS
Adds ingress rate limiting functionality to ConnectivityService. The tc
rate limit is installed before we tell netd about the interface, and
removed after the network is removed from netd. When the setting
changes, the old rate limit needs to be removed before a new one can be
added (unfortunately, we cannot use NLM_F_REPLACE when configuring the
tc-police filter).

Currently, this functionality is always enabled, but may or may not work
based on kernel support.

Bug: 157552970
Test: atest FrameworksNetTests:ConnectivityServiceTest
Change-Id: I4e64b2c40490f061e42b40a1b1b3a6618c3d1a87
2022-02-09 14:46:26 +01:00
Patrick Rohr
a20843638f Add setting that controls network rate limit
The INGRESS_RATE_LIMIT_BYTES_PER_SECOND setting controls the rate limit
for internet networks. If set to -1, no rate limit applies.  There is
one global rate limit that will be applied to all networks with
NET_CAPABILITY_INTERNET.

Test: atest ConnectivitySettingsManagerTest
Bug: 157552970
Change-Id: Ia82aa867686d484ce46734f76d4a48bf864eff84
2022-02-09 14:46:26 +01:00
Treehugger Robot
0ad3becd60 Merge changes from topic "split-pre-jarjar"
* changes:
  Enable framework-connectivity-t-pre-jarjar for service-t
  Split out connectivity-t-pre-jarjar and tests
2022-02-09 12:54:46 +00:00
Remi NGUYEN VAN
2ba9dbe163 Split out connectivity-t-pre-jarjar and tests
The pre-jarjar variant is necessary so that service-t can depend on
hidden symbols in framework-t that reference (for example as parameter)
classes that are jarjared.
Without this, when depending on framework-connectivity-tiramisu.impl,
service-connectivity-t would see post-jarjar symbols that do not match
the classnames it uses in its code.

Also split FrameworksNetTestsLib so that the same jarjar rules can be
applied between the tests and the module, avoiding different errors
between FrameworksNetTests and ConnectivityCoverageTests.

Ignore-AOSP-First: Avoiding conflicts; cherry-pick will follow
Bug: 204830222
Test: m
Change-Id: I3d0c081c4a7422e128beee11c0156f01b0377c96
Merged-In: I3d0c081c4a7422e128beee11c0156f01b0377c96
2022-02-09 18:29:30 +08:00
Chiachang Wang
f890874970 Change naming of excludeLocalRoutes
Address API review feedback to change naming of
setExcludedLocalRoutesVpn and getter.

Bug: 217742354
Test: atest FrameworksNetTests
Change-Id: I57bbf55c7aba1c86ec8687d2431a50b37e63c6d0
2022-02-09 15:50:06 +08:00
Chalard Jean
d490072cd6 Pass the NetworkAgentConfig to NetworkMonitor.
When the network is a VPN, NetworkMonitor needs to know whether
the VPN requests validation, and that information is stored in
NetworkAgentConfig. Pass it.

Test: FrameworksNetTests
Change-Id: I3616f0796b69ce054d92213aafdef43ba7041596
2022-02-09 15:19:38 +09:00
Jean Chalard
4b66d4e244 Merge "Add and implement API for VpnManagers to request validation" 2022-02-09 06:03:45 +00:00
Michael Groover
0762151207 Merge "Marking test receiver as exported." 2022-02-09 05:38:41 +00:00
Chiachang Wang
865511a8c4 Add and implement API for VpnManagers to request validation
This adds a new API that lets VPN apps using VpnManager request
that the platform run its basic validation check on the resulting
network.

Bug: 184750836
Test: atest FrameworksNetTests
Change-Id: I00092eee857d3e33529b19461cfd5dd060a0fe20
2022-02-08 22:47:26 +09:00
Jacob Hobbie
4c06b3885d Marking test receiver as exported.
In order to follow the new dynamic receiver paradigm introduced in T, receivers will have to be specifically marked as exported or not exported when registering dynamically. Since this is in a test only, and the test says that it needs the broadcast to be in a different process, mark as exported.

Bug: 161145287
Change-Id: I112d56962e3a6c3043240f8dfab058dc5a728ba9
Test: atest HostsideRestrictBackgroundNetworkTests#testAppIdle_toast
2022-02-07 15:40:49 -08:00
Etan Cohen
1e86b3af26 Expose public APIs for IP & static IP configuration
Create public API for IP and static IP configuration.

Bug: 209840828
Test: atest android.net.cts.IpConfigurationTest
Test: atest android.net.cts.StaticIpConfigurationTest
Test: atest android.net.dhcp.DhcpResultsParcelableUtilTest
Change-Id: I720f168d1023806970919ca5dd44239a276826b6
2022-02-07 19:57:07 +00:00
Rambo Wang
e7036bec68 Merge "Reduce the flakiness of carrier privileges check" 2022-02-07 03:47:52 +00:00
Jean Chalard
d262e71965 Merge "Use RECEIVER_NOT_EXPORTED in CarrierPrivilegeAuthenticator." 2022-02-04 16:40:30 +00:00
Rambo Wang
4d64bd6b2a Reduce the flakiness of carrier privileges check
Monitoring carrier config change broadcast and then checking
carrier privileges status is racy. The component that updates CP
status (e.g. CarrierPrivilegeTracker) may monitor the same
broadcast and the status check result will be determined by the
fact who received it firstly.

This CL moves the CP check after the current sleep to reduce
the flakiness to unblock the CP migration. The follow CL
(aosp/1971439) will throughly resolve the flakiness by the
the help of CarrierPrivilegesListener.

Bug: 217557996
Test: atest android.net.cts.ConnectivityDiagnosticsManagerTest
Change-Id: Ib1ab554732b6bb25426a07a42043801a2d05c546
2022-02-04 07:55:45 -08:00
Patrick Rohr
f7d2824956 Merge changes from topic "move-testbpfmap"
* changes:
  Extract TestBpfMap from BpfCoordinatorTest.
  Add jarjar rule for com.android.testutils.TestBpfMap
2022-02-04 12:37:50 +00:00
Remi NGUYEN VAN
9335a56282 Merge "Add APIs for discovery with a network request" 2022-02-04 12:07:58 +00:00
Remi NGUYEN VAN
d61719c422 Merge "Add APIs for discover/resolve on specific networks" 2022-02-04 12:07:38 +00:00
Lorenzo Colitti
7569d51446 Use RECEIVER_NOT_EXPORTED in CarrierPrivilegeAuthenticator.
Passing one of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED is
required for all code targeting T or above. The correct value
here is RECEIVER_NOT_EXPORTED because the receiver is being
registered in the system server and the broadcast comes from
the system server itself (same UID).

This does not need to be guarded by OS version because
CarrierPrivilegeAuthenticator is only used on T+.

Test: m
Fix: 217642082
Change-Id: I09840b17bd54352896607737b56c6a692ffbd2c2
2022-02-04 15:31:06 +09:00
Patrick Rohr
3157918fc9 Add jarjar rule for com.android.testutils.TestBpfMap
TestBpfMap needs to be jarjar'ed to work with ConnectivityCoverageTests
which combines both framework tests and tethering tests (and their
respective jarjar rules).

Test: atest ConnectivityCoverageTests:BpfCoordinatorTest
Change-Id: Ie3e7f0be9aeb848978f0df97be48100c808086bc
2022-02-03 22:53:07 +01:00
Remi NGUYEN VAN
792947307e Add APIs for discovery with a network request
Verify that services will be found / lost when underlying networks
change.

Bug: 190249673
Test: atest NsdManagerTest
Change-Id: If62b18a729c6d7b8e2c8701eda6f860ecea4cbaf
2022-02-03 18:39:34 +09:00
Remi NGUYEN VAN
06bdcec9fa Add APIs for discover/resolve on specific networks
Test that NsdManager specifies the correct network when a service is
discovered, and that services can be resolved on a specified network.
Also test that service discovery can be started on a specific network.

Bug: 190249673
Test: atest NsdManagerTest

Change-Id: Ie8b551ce9e33e3adf35f75508f91bbd0df71f837
2022-02-03 16:05:02 +09:00