AServiceManager_waitForService sytem APIs currently only callable
via dlsym(): b/376759605. When built with sdk_version current,
the NDK stubs for "sdk" variants only include NDK APIs,
excluding #systemapi APIs.
Flag: EXEMPT Mechanical refactors
Test: atest ServiceManagerWrapperIntegrationTest
Change-Id: I48f690d771c7905e79e463617ded772f753cc854
Mark Chienauthored and Patrick Rohrcommited 2025-08-06 10:44:39 -07:00
Introduce a 3-second delay in each packet send.
Before sending each packet, wait for 3 seconds to give the
firmware time to turn on the APF.
The firmware may have throughput calculation logic that
depends on a certain time window.
Flag: EXEMPT test only
Bug: 434614102
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV6Test
Test: ./cts-tradefed run commandAndExit cts \
-m CtsConnectivityMultiDevicesTestCases \
-t ApfV6Test --shard-count 2
Change-Id: I0807562cd87cbfe90c90d48cf2d0e41673c153b0
RoutingCoordinatorService's {add,remove,update}Route methods
all end up calling netd's *RouteParcel methods.
Make callers explicitly generate and pass in the parcel to the
manager class instead of having them pass in a RouteInfo and
having the service class convert the RouteInfo to a parcel.
Also remove the {add,remove,update}Route methods from
RoutingCoordinatorManager since they are unused.
This is a no-op refactor that simplifies upcoming changes.
RoutingCoordinator is not a stable interface and is not used
across the platform/mainline boundary, so there are no version
skew considerations.
Bug: 394308861
Test: atest ConnectivityCoverageTests
Flag: EXEMPT no-op refactor
Change-Id: Iedf4c9bc28c3fc8c289db421857acddc8c694990
Lorenzo Colitticommited 2025-08-06 15:57:36 +09:00
S does not have this method (and correspondingly does not have
registerContentObserverAsUser). Use the overload that
does not take a UserHandle.
Bug: 397521796
Flag: TEST_ONLY
Test: test-only change
Change-Id: Icc00abb64fdc47128b93636708990f8ab67057f2
Lorenzo Colitticommited 2025-08-05 18:02:02 +09:00
Throw an IllegalArgumentException if the key or value sizes exceed the
limits supported by the BpfMap implementation. This prevents potential
file descriptor cache collisions and makes errors explicit.
Test: TreeHugger
Flag: EXEMPT mainline/noop
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I3b2b533e4217ee2ab8bfcd71e93b02ffcf9feba9
Maciej Żenczykowskicommited 2025-07-29 19:52:55 -07:00
The `SYS_CLASS_NET_PATH` constant lacked a trailing slash, which
hindered the correct construction of paths for interface-specific
files (e.g., `/sys/class/net/<interface>/mtu`).
This change adds the missing trailing slash, enabling `ProcfsUtils`
to correctly retrieve interface MTU values and other interface-specific
details from `/sys/class/net`.
Flag: EXEMPT mainline
Bug: 429012888
Test: TH
Change-Id: Ib562061d7aa29ed3a7786cca91d79068d4101766
Improve the APF test by changing the packet count assertion from
`== 1` to `> matched_pkt_count_before_test`.
This handles scenarios where the packet counter might already
have a non-zero value or increment due to other traffic, making
the test more reliable. The test now asserts that the specific
test packet caused the counter to increase.
Flag: EXEMPT test only
Bug: 419427388
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV6Test
Change-Id: Id3c0de786e674214948e7030519fe25383c9958c
The test was observed to be flaky when sending a single packet.
Sending three packets increases the likelihood of the test's
assertion passing reliably, addressing potential timing issues
or packet loss.
Flag: EXEMPT test only
Bug: 419427388
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV6Test --iteration 10
Change-Id: I42426d49a81871e6c8e275b1bd8cb0964290ce17
The ByteOrder should be encoded by the field, not by the writeToBytes()
method. To fix this, a LegacyStruct is introduced which continues to
expose writeToBytes(ByteOrder) during the transition. This approach
helpfully creates a compile error when converting a Struct class back to
inheriting from Struct for all call sites of writeToBytes(ByteOrder).
Test: TH
Flag: EXEMPT mainline
Change-Id: I3b28c53ce3e884e59760744838b3518596de5c75
The `expect_with_retry` utility expects the lambda to return a
boolean value. However, the previous implementation wrapped the
comparison result `apf_utils.get_matched_packet_counts(...) == 1`
inside a set `{...}`.
This caused the lambda to return a set (e.g., `{True}` or `{False}`),
which is truthy if non-empty, but not the actual boolean result.
This commit removes the unnecessary set wrapper, ensuring the lambda
directly returns the boolean outcome of the packet count comparison
Flag: EXEMPT test only
Bug: 419427388
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV6Test
Change-Id: Idd77d905e5be7933b3213df5cb772773286becfa
Adds `retry_interval_sec` to the packet count assertion in `ApfTestBase`.
This addresses intermittent test flakiness by allowing more time for the
server device to capture offloaded packets.
Flag: EXEMPT test only
Bug: 419427388
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV6Test --iteration 10
Change-Id: Ia0ac83a7054c6a606f300546306fef1b8fccd701
Log.wtf implies a catastrophic, unrecoverable failure. Failures to read
procfs files (e.g., due to permissions or non-existence) are better
represented by Log.e as they are often recoverable or expected under
certain conditions, and not always indicative of a fatal application state.
Flag: EXEMPT mainline
Bug: 429012888
Test: TH
Change-Id: I717d46d4c3802ac478e80d2a9dd28c79a9ebc5f7
The previous runAsShell calls adopted permissions spuriously. This
change fixes runAsShell to consistently adopt the correct permission
for the respective API call.
Also calls setEthernetEnabled() no matter what the current state is at
the end of the test (as there is no harm in doing so).
Test: TH
Flag: EXEMPT mainline
Change-Id: Ib11b889148213b160567cf0a3b9ea72b5b0c851e
Previously, IPv4 and IPv6 addresses were retrieved in `ApfTestBase.setup_class`,
which meant all APF tests assumed the presence of both.
This change refactors `ApfTestBase` to introduce dedicated methods:
- `get_and_expect_ipv4_addresses_exist()`
- `get_and_expect_ipv6_addresses_exist()`
These methods now handle the retrieval and assertion of IP addresses.
Individual test cases in `ApfV6Test` are updated to call these methods
only when the respective address type is required for the specific test
scenario.
This improves test robustness by ensuring tests only depend on the
necessary IP addresses, allowing for more precise test setup and failure
reporting. Additionally, the doze mode activation is reordered to occur
after initial network setup.
Flag: EXEMPT mainline
Bug: 419427388
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV6Test
Change-Id: I340bcb77fe66cc9927dcd58e5899cdf9a4375daa
This patch checks if interface name is null or empty for
RtNetlinkMessage and ignores the message if it is.
Bug: 429497348
Test: build
Flag: EXEMPT bugfix
Change-Id: I6000f5442f341f152b7fbd235affded0fa56fe50
This refactoring changes how the bluetoothUseRandomAddress flag is
accessed.
PrivateAddressCoordinator is in a library used by multiple mainline
modules(Tethering, NetworkStack, CaptivePortal, WiFi) and cannot
directly read a Tethering mainline beta flag.
To fix this, the flag's value is now passed down through constructors.
An alternative solution would be to split the Java library for each module,
but with this solution, a single utility class cannot be shared.
This commit is a no-op as the passed value is hardcoded to false.
Test: TH
Flag: EXEMPT refactor
Bug: 287177081
Change-Id: I5f2174ee94b55e7a7298b9742221d6e6c3c5cac5
This is a preparation CL before moving VCN code from frameworks/base
to p/m/Connectivity/
This CL defines a utility lib so that the VCN framework code can
use HexDump. With HexDump, VCN will define another lib for the IPsec
module.
Bug: 379938062
Flag: EXEMPT; pure refactoring
Test: FrameworksIkeTests, CtsIkeTestCases
Change-Id: I9bc8b37779315841c2a93328942d073b6bf40808
This is a no-op, test only refactoring.
Move ethernet state management logic from EthernetManagerTest into a
dedicated JUnit test rule, RestoreEthernetRule. This new rule is
responsible for saving the initial ethernet state, allowing tests to
enable or disable it, and restoring the original state upon test
completion. This refactoring simplifies EthernetManagerTest and
promotes code reuse.
Flag: EXEMPT EXEMPT test only refacotring
Test: atest NetworkStaticLibTests:com.android.testutils.RestoreEthernetRuleTest \
CtsNetTestCases:android.net.cts.EthernetManagerTest --update-device
Bug: 410731080
Change-Id: If3dd869d6af4e0c659386621fb5d92012aa574d1
Before moving VCN code, add the new code locations to the
"visibility" fields of Connectivity dependencies.
Bug: 379938062
Flag: EXEMPT; visibility changes
Test: presubmit
Change-Id: I904c601de2b17a9c0460eebde90622963f233567
This commit introduces a verification step that runs before APF
offload tests.
It uses the `cmd network_stack apf <iface> config` shell command
to dump the list of enabled offloads. By checking this list first,
we can ensure that the specific offload under test is actually
enabled, avoiding misleading failures and improving test reliability.
Flag: EXEMPT mainline
Bug: 419427388
Test: ./cts-tradefed run commandAndExit cts -m CtsConnectivityMultiDevicesTestCases -t ApfV6Test --shard-count 2
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV6Test
Change-Id: I65fecdcd4f2f9e9586da2684bf68cec215d0f359
Adds a new helper function `get_apf_config_from_cmd` to retrieve the
list of enabled APF offloads for a given network interface.
Flag: EXEMPT mainline
Bug: 419427388
Test: atest NetworkStaticLibHostPythonTests
Change-Id: I0acc9fcbf2e8bc6f4d8f309c2ec64c003c325c42
The monolithic EthernetStateListener has been refactored and split
into two specialized test classes:
- TestInterfaceStateListener: For interface state callbacks.
- TestEthernetStateListener: For ethernet state callbacks.
Both new classes now extend TestableCallback, providing a standardized
and more robust way to manage and verify listener interactions in
unit tests. This improves testability and clarity of test code.
This is a no-op, test-only change.
Flag: EXEMPT refactor
Test: atest CtsNetTestCases:android.net.cts.EthernetManagerTest
Bug: 410731080
Change-Id: I667e3607954dcb073b2732b16bedfbc71a70bb39
This is a no-op, test-only change.
Move EthernetStateListener from EthernetManagerTest.kt to a new
standalone file in testutils.
This refactoring makes the listener reusable across other tests and
decouples it from its dependency on EthernetTestInterface.
Flag: EXEMPT refactor
Test: atest CtsNetTestCases:android.net.cts.EthernetManagerTest
Bug: 410731080
Change-Id: Iacd9236f758011da0714884040aebe3e42ef1646
Junyu Laiauthored and Chalard Jeancommited 2025-07-04 13:03:55 +09:00