Ethernet service sources are moving to Connectivity module, which has
dependency on the NetworkFactory class such as EthernetNetworkFactory.
Import this lib in service-connectivity-tiramisu-pre-jarjar to fix this
dependency.
Bug: 202086915
Test: m
Change-Id: I2f92479f56af110d89c9fa95eca725af7132b66f
IBpfMap#forEach allows concurrent map access (deleting from the map
while iterating), so we should allow this in TestBpfMap as well.
Test: builds
Change-Id: I89dc7e4daf1d0cfc1aac57cad4ea7f1e50f5f20c
Currently, expectAvailableCallbacks requires that the caller know
in advance what the validation state is. This CL allows the
caller to pass in validated = null to indicate that it does not
matter whether the network is validated or not.
Test: modified CTS test in other CL in topic
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Change-Id: Ie54806a4a1d907de630819e11f9e34602cc55ef4
Lorenzo Colitticommited 2022-02-17 17:45:05 +09:00
Generic bitmap class for use with bpf programs. Internally
uses bpfMap with key/value.
Test: atest BpfBitmapTest
Change-Id: Ica912b080849b50614e30ee168992c9ada74068c
The library pulls a lot of dependencies, which end up in code coverage
reports, because code coverage looks at code inside the test package
unless excluded.
Just use the existing TestPermissionUtil in the same library instead,
avoiding the need to exclude many test utilities and making the test
smaller.
Test: atest android.net.cts.ConnectivityManagerTest#testDump
Change-Id: I3ba2121ef034872acf077578644ac9e8aa92c7ef
Converting BiConsumer to ThrowingBiconsumer allows an
exception to correctly be thrown from the BiConsumer action
in forEach() from BpfMap.
Change-Id: I34363c5aa8b07c4cbd703e899381a95062d2b75b
TCA_U32_ACT was missed when converting from the u32 filter to matchall.
Interestingly, cls_matchall does not seem to validate this type as the
kernel happily accepted this configuration (which absolutely should not
happen as TCA_U32_ACT is greater than __TCA_MATCHALL_MAX).
Bug: 218840346
Test: atest CtsNetTestCases:RateLimitTest
Change-Id: Ia24683cbd5fbd10084163db6e6a4415ec03f6f3f
The art apex already has access to bpf_headers which includes bpf_syscall_wrappers,
but this extra line is needed to switch it away from needlessly linking libbpf_android.
Since these are header files only, this annotation is kind of pointless,
but it does turn out to be needed...
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9e4d3373cea488080304e31ed7c8708aec988933
Maciej Żenczykowskicommited 2022-02-09 22:23:01 -08:00
Introduces three new useful utilities into the static f/l/n common libraries.
Test: used in ConnectivityManagerTest CTS, atest ConnectivityManagerTest
Change-Id: I83aca0b105b6d697768d263db76e0c521667942e
this doesn't appear to make sense now that it's available to vendors
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: If2d24fa8eccfb5c12832fb191a8560b024751db7
Maciej Żenczykowskicommited 2022-02-09 19:33:20 -08:00
Attach bpf program to cgroup with flags, support 'BPF_F_ALLOW_OVERRIDE'
and 'BPF_F_ALLOW_MULTI'; corresponding to detach a single bpf program in
a cgroup.
Test: m
Signed-off-by: KaiWen Zheng <zhengkaiwen5@xiaomi.corp-partner.google.com>
Change-Id: I9a4d2dcb249c6c628e3f1287d7d5d1879b722bd6
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: I77142c784e20fd74d4aa5dd34858159e232abbe3
Hungming Chenauthored and Nucca Chencommited 2022-02-09 07:58:39 +00:00
This patch allows not passing a network to expectCallback
to allow receiving a callback when the network isn't known.
This is supported in other expect* methods but somehow was
missed in this one.
Test: Ikev2VpnRunnerTest, which uses this ability
Change-Id: Ifd20dd8789ff8b277bac3a73ddd23e2fe9febbca
The dependency is necessary as it builds against module_current and uses
APIs moved there.
Ignore-AOSP-First: Avoiding conflicts, cherry-pick will follow
Bug: 197717846
Test: m
(cherry-picked from ag/16770415)
Change-Id: I150adbdcc6ba48e0fade9f43242ef5d2f8d7cea0
Merged-In: I150adbdcc6ba48e0fade9f43242ef5d2f8d7cea0
Remi NGUYEN VANauthored and junyulaicommited 2022-02-08 18:49:16 +08:00
- Move it to frameworks/libs/net/common/testutils.
- Inherit from BpfMap, so the class can be used anywhere that
uses a real BpfMap. For example, BpfCoordinatorTest uses
BpfMap, not IBpfMap.
Test: atest BpfCoordinatorTest
Change-Id: I7ee65e47fa46ac6aafc831f5b1823b44267ba2a6
Lorenzo Colitticommited 2022-02-02 00:25:40 +00:00
This way, users of libnet_utils_device_common_bpfjni do not also have to
separately list the required libtcutils.
Test: build, boots
Change-Id: Id40863de83b6c40b79f38d638299626f7e025810
Patrick Rohrauthored and Maciej Żenczykowskicommited 2022-02-01 03:07:46 +00:00
Package-private members are not visible across jars; with the latest
refactoring of build and jarjar rules for connectivity, tests fail as
the utils are picked up from the on-device module rather than the test
package, and such members could not be found.
Bug: 204830222
Test: atest ConnectivityCoverageTests
Change-Id: Ia62b01e2e3123a2d8a432c061e3c576c86356df5
Added SPDX-license-identifier-Apache-2.0 to:
common/native/nettestutils/Android.bp
Bug: 68860345
Bug: 151177513
Bug: 151953481
Test: m all
Change-Id: If5fcd4735fe82f336227626a443bba1d74201722