Commit graph

43,836 commits

Message SHA1
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

Remi NGUYEN VAN   commited 2022-02-16 15:22:30 +09:00
3b81323e4a
Add ThrowableBiConsumer to BpfCoordinatorShim
Change-Id: Iecf001ac6d9f53a64f903f5b8ab069d6be93f50a

Tyler Wear   commited 2022-02-15 16:59:07 -08:00
6d80f10bb3
Merge "Add KeepalivePacketData toString()"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-15 10:54:37 +00:00
c05d86b850
Merge "Address comment from aosp/1948169"
Wayne Ma   authored and   Gerrit Code Review   commited 2022-02-15 10:33:23 +00:00
622c72ea49
Address comment from aosp/1948169
Bug: 202086915
Test: m; flash; boot;
Change-Id: Ic989fa2a58edb15155fba175d4cdf8952b511ae7

Wayne Ma   commited 2022-02-15 14:54:45 +08:00
510c2f463f
Merge "Move permissions allowlist for Tethering"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-15 04:43:27 +00:00
a828eb711c
Merge "Dump BPF map in base64 encoded strings for testing"
Nucca Chen   authored and   Gerrit Code Review   commited 2022-02-14 10:07:09 +00:00
61ef984d52
Merge "Allow test+other networks to have specifiers"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-02-14 05:31:20 +00:00
106569b856
Merge "Add new methods to redact NetworkCapabilities & LinkProperties"
Jean Chalard   authored and   Gerrit Code Review   commited 2022-02-12 11:56:36 +00:00
d537aa42e1
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

lucaslin   authored and   Chalard Jean   commited 2022-02-12 15:21:13 +09:00
c582d50b8e
Add KeepalivePacketData toString()
Test: build
Bug: 218569712
Change-Id: I24c0e7ab94212ddf71812ebcc81a5fa69abfa860

Ling Ma   commited 2022-02-11 19:17:10 +00:00
4d782d6d74
Merge "Remove unused BpfNetMap jni function"
Mark Chien   authored and   Gerrit Code Review   commited 2022-02-11 13:32:36 +00:00
c8f38c77a9
Merge "Fix tab by replacing it with spaces"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-11 09:35:32 +00:00
d6751bd159
Merge "Refer to SDK constant defined in DevSdkIgnoreRule"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-11 09:23:02 +00:00
5be94579d4
Remove unused BpfNetMap jni function
native_deleteTagData and native_setCounterSet is replaced as BpfMap java
implementation inside NetworkStatsService.java

Test: atest traffic_controller_unit_test
Change-Id: Ic33ca9d9887380d39becbd0dc3a0e159b3dc82a2

markchien   authored and   Mark Chien   commited 2022-02-11 08:04:55 +00:00
4dd5be6606
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

Chiachang Wang   commited 2022-02-11 07:40:58 +00:00
137bbed860
Fix tab by replacing it with spaces
Test: no code changes
Change-Id: I3644c4914486189d58c8e59ac62c6856296cce08

Aaron Huang   commited 2022-02-11 13:52:29 +08:00
b5af0fe5dc
Merge "[LSC] Add LOCAL_LICENSE_KINDS to packages/modules/Connectivity"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-11 02:41:54 +00:00
9fb978d7d7
Merge "Add @SupressLint to get around incorrect warning."
James Mattis   authored and   Gerrit Code Review   commited 2022-02-10 22:26:06 +00:00
38872800dd
Merge "remove unneeded inclusions of libbpf_android"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-10 19:50:34 +00:00
0fc2ec6d68
[LSC] Add LOCAL_LICENSE_KINDS to packages/modules/Connectivity
Added SPDX-license-identifier-Apache-2.0 to:
  netd/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: Ib1377fbb050fe52ee195eec58fea67ef769a487a

Bob Badour   commited 2022-02-10 10:57:23 -08:00
4ef4a444e8
Move permissions allowlist for Tethering
The allowlist will now be in the apex instead.

Test: boots && check permissions.xml is bundled
Bug: 190375768

Change-Id: Ia7434cba54d2b51479e52323f22c7f454499991d

Andrei Onea   commited 2022-02-10 15:04:46 +00:00
52eac028fc
Merge "Move IpSec APIs to Connectivity module"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-10 11:45:21 +00:00
baefbc3375
Merge "Add Low Power Standby test to NetworkManagementServiceTest"
Robert Horvath   authored and   Gerrit Code Review   commited 2022-02-10 11:17:44 +00:00
3a33495992
Merge "Add visibility for core tests"
Junyu Lai   authored and   Gerrit Code Review   commited 2022-02-10 09:23:57 +00:00
d54fcc49a7
Merge "Add OWNERS for Nearby code"
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-02-10 08:16:55 +00:00
bf9d21a6d2
Add OWNERS for Nearby code
Add owners to Nearby members for the nearby directory and framework-t
API directory.

Test: m
Change-Id: I1095064de389ab5f035d8750c0106195d1c167ac

Remi NGUYEN VAN   commited 2022-02-10 15:27:29 +09:00
d8965edd3d
Move IpSec APIs to Connectivity module
(cherry picked from commit 68ca373929)
Bug: 204153604
Test: TH
Change-Id: If4afabdc65ed2ac3e918af1d4a03c4c9173c4a3c
Merged-In: If4afabdc65ed2ac3e918af1d4a03c4c9173c4a3c

Aaron Huang   commited 2022-02-10 14:25:04 +08:00
2e778ee46b
remove unneeded inclusions of libbpf_android
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I6aedf507e09effd9076de85a0acc7aaf1b8e4a1e

Maciej Ĺ»enczykowski   commited 2022-02-09 22:10:22 -08:00
11ab996252
Merge "[MS55.2] Move NetworkStateSnapshot into module folder"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-10 05:02:45 +00:00
a8ae24410d
Merge "Change naming of excludeLocalRoutes"
Chiachang Wang   authored and   Gerrit Code Review   commited 2022-02-10 00:50:30 +00:00
84ad04f768
Add @SupressLint to get around incorrect warning.
EthernetNetworkSpecifier is being moved from being @SystemApi to public.
This is causing the linter to incorrectly throw errors when building on
erro prone. Add @SupressLint to the method causing the errors prevents
the incorrect warning from causing build failures.

Tracking bug b/193460475 - TODO to remove once fixed.

cherry pick of http://ag/16822701

Bug: 210485380
Test: build errorprone
Change-Id: Id297e739a2288ccc232c6b989ec7fee41837a910
Merged-In: Id297e739a2288ccc232c6b989ec7fee41837a910

James Mattis   commited 2022-02-09 11:22:11 -08:00
d8afb66b11
Merge changes from topic "bandwidth-limiting"
* changes:
  Add bandwidth limiting to CS
  Add setting that controls network rate limit

Patrick Rohr   authored and   Gerrit Code Review   commited 2022-02-09 18:00:04 +00:00
6b5b7b40d8
Merge "Pass the NetworkAgentConfig to NetworkMonitor."
Jean Chalard   authored and   Gerrit Code Review   commited 2022-02-09 16:55:59 +00:00
ec05b337aa
Merge "Mark NetworkAgentConfig fit for inclusion in stable AIDL"
Jean Chalard   authored and   Gerrit Code Review   commited 2022-02-09 16:55:44 +00:00
66fbc7df52
Add visibility for core tests
Allow core tests to use hidden connectivity APIs. Benchmark tests in
particular cannot be run without these.

Ignore-AOSP-First: Avoiding merge conflicts, cherry-pick will follow
Bug: 197717846
Test: m
  (cherry-picked from ag/16772124)
Change-Id: Ia01f24317d14b063f9a7e24c3ada11b140641c50
Merged-In: Ia01f24317d14b063f9a7e24c3ada11b140641c50

Remi NGUYEN VAN   authored and   junyulai   commited 2022-02-09 23:08:37 +08:00
85a4e07826
Merge "Move Tether4Key and Tether4Value to common libs"
Nucca Chen   authored and   Gerrit Code Review   commited 2022-02-09 13:53:41 +00:00
34e16b9537
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

Patrick Rohr   commited 2022-02-09 14:46:26 +01:00
2857ac4dd0
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

Patrick Rohr   commited 2022-02-09 14:46:26 +01:00
a20843638f
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

Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-09 12:54:46 +00:00
0ad3becd60
[MS55.2] Move NetworkStateSnapshot into module folder
framework-connectivity need to see the aidl files when
compiling IConnectivityManager.aidl, and it can only
include the files by specifying aidl include_dirs.
Thus, move the file into the module since the one outside
of the module is going to be deleted soon.

Ignore-AOSP-First: Avoiding conflicts; cherry-pick will follow
Test: TH
Bug: 197717846
Change-Id: Ide7431d0c98aebd389bee86d13ff44f5ef8b8283
Merged-In: Ide7431d0c98aebd389bee86d13ff44f5ef8b8283

Junyu Lai   commited 2022-02-09 10:51:37 +00:00
dc0d521f63
Merge "Have connectivity targets be visible to Frameworks[Vcn|Ike]Tests"
Aaron Huang   authored and   Gerrit Code Review   commited 2022-02-09 10:48:45 +00:00
e25900bbbf
Dump BPF map in base64 encoded strings for testing
Test: atest EthernetTetheringTest

Change-Id: I3ae863cbb8ed0af1ffc78c6dda21b9e3c0ac74c9

Hungming Chen   authored and   Nucca Chen   commited 2022-02-09 10:46:54 +00:00
3de910ea96
Move Tether4Key and Tether4Value to common libs
EthernetTetheringTest needs to parse BPF map content for IPv4
forwarding rule tests. Move the struct class files to common
libs.

Compare Tether4{Key, Value}.java between frameworks/libs/net/common
and packages/modules/Connectivity/Tethering.
There is only the package name change as expected.

$ diff packages/modules/Connectivity/Tethering/src/com/android/networkstack/tethering/Tether4Key.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/Tether4Key.java
17c17
< package com.android.networkstack.tethering;
---
> package com.android.net.module.util.bpf;

$ diff packages/modules/Connectivity/Tethering/src/com/android/networkstack/tethering/Tether4Value.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/Tether4Value.java
17c17
< package com.android.networkstack.tethering;
---
> package com.android.net.module.util.bpf;

Test: atest TetheringCoverageTests

Change-Id: I73c180fa4129aefde1e64ecbafe928f388b061d6

Hungming Chen   authored and   Nucca Chen   commited 2022-02-09 10:45:37 +00:00
887a22cc4a
Enable framework-connectivity-t-pre-jarjar for service-t
framework-connectivity-t-pre-jarjar build target is needed
by service-t, thus, enabled this target on sc-mainline-prod
but still keep framework-connectivity-t disabled.

Bug: 204830222
Test: m
Change-Id: I03cbdb57966b746f3c93e989394a4dc999fe863a

junyulai   commited 2022-02-09 18:29:56 +08:00
91e3dc2fe6
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

Remi NGUYEN VAN   authored and   junyulai   commited 2022-02-09 18:29:30 +08:00
2ba9dbe163
Merge "Change gid of cgroupskb/<ingress|egress>/stats"
Ken Chen   authored and   Gerrit Code Review   commited 2022-02-09 09:41:56 +00:00
d04a1ef466
Change naming of excludeLocalRoutes
Address API review feedback to change naming of
setExcludedLocalRoutesVpn and getter.

Bug: 217742354
Test: atest FrameworksNetTests
Change-Id: I57bbf55c7aba1c86ec8687d2431a50b37e63c6d0

Chiachang Wang   commited 2022-02-09 15:50:06 +08:00
f890874970
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

Chalard Jean   commited 2022-02-09 15:19:38 +09:00
d490072cd6
Mark NetworkAgentConfig fit for inclusion in stable AIDL
Test: m together with its topic
Change-Id: I897a2081fb48a614f28d9ec3965f99cca9f8ec62

Chalard Jean   commited 2022-02-09 15:19:38 +09:00
3068ce7378