In fact the test already passes, because addSuppressed contains
an explicit test that if this === argument, then it doesn't add
it. But otherwise that's a bug in tryCleanup
Test: NetworkStaticLibTests
Change-Id: I202790bbe8d82445c5affdd9076561c2c6ea9b59
Move test classes that were not in the same com.android.module.util
package as their associated class into the right package, and make
net-utils-service-common visible to tests.
Bug: 207020032
Test: atest ConnectivityCoverageTests
Change-Id: Iabe86a7d4c2437b3d01d68d53fb01d4e3c05a02b
Enable the strict_updatability_linting here first as a prior
commit to enable strict_updatability_linting in connectivity
modules.
Bug: 188851968
Test: m lint-check ; atest NetworkStaticLibTests
Change-Id: Idac98a1c85bf5bb86269b1daad2b444cfb58db8a
Added SPDX-license-identifier-Apache-2.0 to:
common/testutils/app/connectivitychecker/Android.bp
Bug: 68860345
Bug: 151177513
Bug: 151953481
Test: m all
Change-Id: I9e25f435ce9835f12a167e6c57e33f6d87c159de
* changes:
Separate bpf and struct util from netlink util library
Use JniUtil.getJniLibraryName to find library name
Add JniUtil to identify jni library by package name
Maciej Żenczykowskiauthored and Gerrit Code Reviewcommited 2021-11-11 13:19:48 +00:00
1. Separate bpf and struct libraries from netlink library.
2. Rename bpfmap jni library to respect its java side library.
3. Add README to explain the rules of adding shared jni library.
4. Also allow packages/modules/Connectivity to use bpf library.
Bug: 205088391
Test: atest TetheringTests
atest CtsTetheringTest
atest TetheringPrivilegedTests
atest ConnectivityCoverageTests
Change-Id: I6e668818bede63b241cd901c0967f401613ddaf6
The constant is useful for both Connectivity and Tethering when they
want to check the APEX version. Include it in DeviceConfigUtils, as this
is what it will be used for.
Bug:
Test: atest ConnectivityServiceTest
Change-Id: Ib7a7677ca2954974613df25a105a65fe5d971afc
ConnectivityCheckTargetPreparer is a tradefed target preparer that uses
the connectivitychecker app to verify device configuration, before
running any test.
The connectivitychecker app verifies that the device has a
pre-configured wifi configuration and can connect to it (except for
virtual devices where it may create the configuration itself), and
verifies that the device has a data-enabled SIM card inserted.
Checks are skipped if the device is not wifi- or mobile data-capable,
and can be skipped for local testing by running with:
atest X -- --test-arg \
com.android.testutils.ConnectivityCheckTargetPreparer:disable:true
Test: atest CtsNetTestCasesLatestSdk
Change-Id: I5b6d34a6c393863af23af57ff026b15973e9e784
- Move PolicyDirection into frameworks/libs/net
- Add net-utils-annotations lib for those methods that are using
PolicyDirection annotation.
- Add net-utils-annotations-srcs for including PolicyDirection to
their filegroup.
Bug: 203634639
Test: m
Change-Id: I7b8b3bdcc3be5fca9baa5a9ce656756843e03527
Multiple packages need access to bpf maps. Moving to common
location to allow access from all necessary packages.
Test: atest BpfMapTest
Bug: 179733303
Change-Id: Idae7b620c15c781b2e7980c3a3157f396cfaf66e
We should be using the lib instead.
Unfortunately net-utils-framework-common can't do the
same move just yet because many targets depend on it
that only build against system_current.
Test: builds
Change-Id: I9f70f4cc31e0270cc05ef71ba1803c2d088937d6
These classes used to live as a static utility in the
NetworkStack module, but that's not the right place for
them.
The point of this patch is to *not* require topics, as
any change in this space will very quickly spin out of
control and become unmanageable. As such, this starts
with creating equivalent classes in a single, easier to
manage change. Followup changes will migrate users of
the old classes to use these ones instead. Finally, the
old classes can be removed. This way, work can be
broken down into separate changes and be checked in
little by little, rather than one huge topic with many
changes doing everything in one go, which is unlikely
to be manageable.
There are no code changes from the originals, but a
number of reorganizations, most of them unavoidable.
• Vertical spacing (these classes fix it)
• Package names/imports are adjusted
• Added @hide on NetlinkMonitor
• Move all contents of RouteUtils to NetdUtils, because
all methods depend on INetd, and some of the targets
do not/cannot depend on netd-client
• Restrict the files used by the filegroup
net-utils-framework-wifi-common-srcs, since that
target does not necessarily provide all dependencies
to all its users.
• Don't move NetworkMonitorUtils, since it depends on
SdkLevel, and net-utils-framework-common-srcs is
using **/*.java. It would have been possible to list
explicitly all files actually necessary in this
filegroup, but NetworkMonitorUtils is actually only
used by the networking modules and not the framework.
Eventually it should move but it doesn't have to
be in this patch, which is complicated enough as
it is.
• RouteUtils is now empty, because some new methods
will be added to it soon and it is less expensive
to keep it empty than to remove it now and add it
again later.
• Merge NetdUtils, and unify the constants.
Some changes to satisfy checkstyle :
• Remove unused imports
• Reorder modifiers in InterfaceController
• Remove {} in IpNetworkMonitor
• Remove redundant public modifier in IpNetworkMonitor
• Add javadoc to a few methods
• Add whitespace around | in InterfaceParams
However, don't rename members in IpNeighborMonitor
like checkstyle would prefer because this would make
migration to this more involved.
Test: NetworkStaticLibsTests NetdStaticLibTests
Change-Id: I439121cba5d7ea95aa4d6c80ea25207c316880a0
Export BPF headers to connectivity service for use with
VendorConnectivityService aidl.
Bug: 179733303
Change-Id: Ibc098facde54aeb621e53b73ac59eb6416ba9ebb
Tyler Wearauthored and Maciej Żenczykowskicommited 2021-10-20 01:02:31 +00:00
Binder#withCleanCallingIdentity is a very useful utility but
it's not public and won't be made public. Thus, make one
in the connectivity module utils for later use.
Test: TH
Fix: 177369996
Change-Id: I3fd0949b7457f9d8bca8613c2bae7ef7a35a5c4c
Added SPDX-license-identifier-Apache-2.0 to:
common/netd/Android.bp
Bug: 68860345
Bug: 151177513
Bug: 151953481
Test: m all
Change-Id: Ic163988eea096e967a8d04624772b2eff350026d
Clean move system/netd/server/aidl_api/ and
system/netd/server/binder/
$ diff -qr frameworks/libs/net/common/binder/netd/aidl_api/ system/netd/server/aidl_api/
$ diff -qr frameworks/libs/net/common/binder/netd/src/ system/netd/server/binder/
Only in system/netd/server/binder/: com
Bug: 201488997
Test: atest netd_integration_test
atest netd_unit_test
Ignore-AOSP-First: the netd change(same topic) would not automerger from
aosp.
No-Typo-Check: this is a simple code move with no other changes.
BYPASS_INCLUSIVE_LANGUAGE_REASON=this is a simple code move with no other
changes and these files are frozen anyway
Change-Id: Id5bb63794aff4025355c587b372c3ff5b1054da6
Merged-In: Id5bb63794aff4025355c587b372c3ff5b1054da6
Since the counter part test is in internal branch only.
Change the member of OnSetLimit makes it fail to build on the
rvc+aosp branch.
Thus, add a getter for backward compatibility since the rvc test
does not recognize limitBytes.
This change also addresses some nullability confusions that are
not going to happen.
Test: m gts && atest \
GtsNetworkStackHostTestCases:NetworkStatsHostTest#testNetworkStatsProvider
on R & S codebase.
Bug: 191327585
Change-Id: I91dc8cb2297ca503c49b78bf1102cc5572d16530
This change also address left comments at ag/15010113.
Test: m gts && atest \
GtsNetworkStackHostTestCases:NetworkStatsHostTest#testNetworkStatsProvider
Bug: 191327585
Merged-In: I100668cc6d4cecbaff29d027d37d313dd48854f3
Change-Id: Ib1f3820fe8502b939d36cef29bdb8dea428604b5
(cherry-picked from ag/15061296)
Add @NonNull and @Nullable annotations on StructNlMsgHdr and parse
function to give the caller a clear indication the StructNlMsgHdr
should be non-null and safe to call its public method, avoid throwing
NPE; the same for parse code, which might return null and caller
should check the nullability of return value.
Bug: 163492391
Test: atest NetworkStaticLibsTests
Change-Id: I0cdf6e611a2b5398b048ffc02ec8fb5f8f8a73db
DevSdkIgnoreRule currently considers a build with SDK 30, version code T
as being S, but it is generally considered as being T for development
that happens in that branch.
Change the implementation of DevSdkIgnoreRule to be consistent with the
SdkLevel utility.
Test: tests using DevSdkIgnoreRule
Change-Id: Ie81b84dff8fef8eac2cfe9694f0265e5bf11b3e6
A common pattern in tests is to use try-finally to make sure
cleanup is executed. This is necessary in CTS in particular to
make sure the test does not leave the device in a bad state.
The problem with using try-finally in this manner is that any
exception thrown in the finally{} block will override any thrown
in the try{} block. If the exception in finally{} is caused by
the one from try{}, then the stack trace reported by the tools
is the consequence and not the cause, making it difficult to
interpret the stack trace of automated tests.
So today, code has to make sure that either the code in
finally{} can't throw, or can't be affected by any code in
try{}, and both of these are really difficult to ensure in
presence in finally{} of code the tester does not control.
What we'd want ideally is a structure like try-finally, that
guaratees the code in finally{} is executed in all cases,
but that bubbles up the exception from try{} if any, and
will still bubble up any exception from finally{} if the
try{} block hasn't thrown.
That's what this new tool does.
Usage from Kotlin is like try-finally :
tryTest {
testing code
} cleanup {
cleanup code
}
Usage from Java can't be made as nice, but it's relatively okay :
testAndCleanup(() -> {
testing code
}, () -> {
cleanup code
});
Bugs listed below are some tests that have been affected by
this issue and have unhelpful traces.
Test: new test for this code
Bug: 198586720
Bug: 198998862
Change-Id: I54b30a7d53772feeade99274b6120a79707ad1c9