This CL calls UserHandle.getAppId to make sure the UID check with
Process.SYSTEM_UID and PHONE_UID are multiple-user-aware.
In multiuser context, Process.SYSTEM_UID or PHONE_UID is NOT the UID
of system/phone but the app id. The complete UID is prefixed with
user id (e.g. 1001001 is phone UID for user 10).
Bug: 328511085
Test: atest FrameworksNetCommonTests
Flag: EXEMPT Tiny bug fix
Change-Id: I97bbfcff37374ba367fc8d62400ae140136cd012
rambowangauthored and Rambo Wangcommited 2024-07-09 17:37:27 +00:00
* changes:
Revert logging changes for empty netbpfload prog
Do not test Log.wtf reporting pipeline on V+
Revert "Revert "Add a Log.wtf() on user builds to test Pitot rep..."
Revert "Revert "Add a temporary hack to CS to report netbpfload ..."
Remi NGUYEN VANauthored and Gerrit Code Reviewcommited 2024-07-09 09:48:02 +00:00
Recent ConnectivityService does not use the empty netbpfload program
used for the logging in these changes. Revert changes that were added
temporarily for merge conflict purposes.
This reverts commit 1c351b2c4a.
This reverts commit 4bf2d4e8cd.
This reverts commit 295746d2bf.
Change-Id: Ifec055938b4a1f684299662c1661a8ae13b0aedb
On U QPR3+, networking bpf programs are already loaded by netbpfload, so
there is no point in checking the netbpfload result. The system will
likely abort if anything was not loaded correctly.
Checking the netbpfload result is only really relevant on devices before
V that receive netbpfload via mainline update.
In addition, removing the Log.wtf from V+ devices prevents Android Go
devices that use non-updatable modules from reporting wtf logs for a
very long time.
Test: TH
Bug: 351118770
Change-Id: I8a412cb25374f3637f2fbd89617baa58d41d8589
Patrick Rohrauthored and Remi NGUYEN VANcommited 2024-07-09 17:18:30 +09:00
Without lock, it's not guaranteed that the methods see values
populated by the constructor
Bug: 349952743
Test: TH
Change-Id: I5c98766a22047f49ad3338bfe620d3b8f4ef477e
- This CL puts RoutingCoordinator into staticlibs to make it usable by
both Tethering and ConnectivityService on R.
- This CL also changes the return type of
ConnectivityInternalApi#getRoutingCoordinatorManager() to IBinder so
it has fewer dependencies.
Bug: 350699020
Test: CI
Change-Id: Iba096e940795cd33e61c5141721394ad39e5ce6d
This CL introduces net-utils-framework-connectivity, net-utils-tethering
and net-utils-service-connectivity as staticlibs.
- net-utils-framework-connectivity will be used by
framework-connectivity-pre-jarjar.
- net-utils-service-connectivity and net-utils-tethering are the
static liraries used by service-connectivity-pre-jarjar and Tethering
respectively.
Bug: 350699020
Test: CI
Change-Id: I4dbb2b0de905a576cfcf24d2d5d1f1a261d2bd68
This reverts commit d6fa127ec0.
Reason for revert: updating lint-baseline.xml does not cause build brekage; keep holding back the separate CL that turns FlaggedApi violations into errors
Change-Id: Ie5d048bde1c0b717cb0d589d33550e6b68154be8
MĂĄrten Kongstadauthored and Gerrit Code Reviewcommited 2024-07-04 06:31:15 +00:00
For tests that register multiple callbacks, like ConnectivityService
tests, this can make it easier to figure out which callback is getting
called in logs.
Test: atest CtsNetTestCases (tests using this callback)
Bug: 327038794
Bug: 279392981
Change-Id: Ifea5a8180f9667feaadf94c8b927469bafe29590
Revert submission 3156916-flagged-api-lint-baseline
Reason for revert: Droidmonitor created revert due to build breakages in b/350976857.
Reverted changes: /q/submissionid:3156916-flagged-api-lint-baseline
Change-Id: I52ca486a00d47f478c61ce0ae39b9d9b584af87e
Priyanka Advaniauthored and Gerrit Code Reviewcommited 2024-07-03 19:53:58 +00:00
These were originally split in two, so low-level BPF could be changed
more easily. With the introduction of MCTS, updatability of CTS tests is
not a concern anymore, so these tests can be merged back together.
Test: atest TetheringIntegrationTests
Change-Id: Ia0bd91470d445e90230f7a9546de1cb56deef9cc
Instead of printing the flags as hex, use flag names for known flags.
Bug: 327038794
Bug: 279392981
Test: atest
Change-Id: I11ba4de1e8e60d5468a72b275cd724be669b32bc
This change conduct a basic APF multi-device test, which includes:
1. Setup a hotspot with a client connect to it.
2. Use adb command to instruct the client to enable doze mode to
activate APF on the client device.
3. Use a command to instruct the hotspot device to send
an empty broadcast EtherCat packet.
4. Parse dumpsys on the client device to get APF counters.
5. Verify the corresponding APF counter increases.
This change also fix some lint errors suggested by pyformat.
Test: m connectivity_multi_devices_snippet && \
atest CtsConnectivityMultiDevicesTestCases:ConnectivityMultiDevicesTest
Fix: 335368434
Change-Id: Ic5aecbf316f150c5b975e5dfe6cd110bd42c2135
This is now derived from the passed packet data by
NetworkStack.
Test: m connectivity_multi_devices_snippet && \
atest CtsConnectivityMultiDevicesTestCases:ConnectivityMultiDevicesTest
Test: atest NetworkStaticLibHostPythonTests
Bug: 335368434
Change-Id: Ida06c00e6f499b782cb903c9fa0a4154c2d8cf84
This commit introduces the use of VirtualEnv to manage test
dependencies. Specifically:
1. `PythonVirtualenvPreparer` is invoked before running tests
to set up the isolated Python environment.
2. The test is declared as a `MoblyBinaryHostTest` to enable
VirtualEnv compatibility, as `PythonBinaryHostTest` lacks
this support.
3. The Mobly test runner is invoked manually to accommodate
multiple test classes, which is not supported by
`mobly.test_runner.main()`.
4. Test classes are refactored to inherit from
`mobly.BaseTestClass` for compatibility with the Mobly
test runner.
This change is a prerequisite for subsequent commits that will
install libraries via `pip install`, facilitating isolated
dependency management for improved test reliability and
maintainability.
Also, this commit uses parameterized annotation from absl
to rewrite several tests as paremeterized tests.
Test: atest NetworkStaticLibHostPythonTests
Bug: 335368434
Change-Id: Iffa2f8fa81c3913f3e08cca01b2c009ca959db73
This change moves the null check into the service implementation. Since
exceptions on oneway binder interfaces are ignored (across process), the
code was changed to just return early instead.
This also adds a couple of Objects.requireNonNull() assertions in
TetheringManager to assert the existing @NonNull annotation.
Test: TH
Bug: 337167681
Change-Id: I5301ed084bb26c2f910041e9b25314f8181718d1
The Lint FlaggedApi checks are currently configured as warnings. Add
existing violations to baselines files to prepare for turning the
FlaggedApi checks into errors.
Bug: 303434307
Test: treehugger
Flag: EXEMPT not possible to flag baseline changes
Merged-In: I5cbff0293af79e68057fd42ecfa8d2c8af31ae6a
Change-Id: I5cbff0293af79e68057fd42ecfa8d2c8af31ae6a
These tests are run as part of the MTS suite, setting min_sdk_version
ensures that these tests can be installed on an older device and test
the corresponding mainline module.
Test: atest [<mod_name>...]
Bug: 156476221
Change-Id: Ic94b00ee1818063fc9f13e4ecffaca88f58c30c3
Calling setIncludeTestInterfaces(false) in tearDown() is not needed as super.tearDown() already takes care of it. In addition, the parent class's tearDown method also checks whether ethernet is supported and the tests actually ran. Leaving the setIncludeTestInterfaces(true) in setup is fine, as super.setUp() fails with an assumption violation if ethernet is not supported.
Note that this is a bit of a hack. NsdManagerDownstreamTetheringTest should not use EthernetTetheringTestBase as a base class (and EthernetTetheringTestBase should be deleted).
Change-Id: Ie1557250166fbf30c98e87dc2ffb4c3e001be167
Test: TH
Bug: 341063340
This commit includes several new functions to support sending custom
raw Ethernet packets. This includes methods for retrieving
MAC addresses, sending empty EtherCAT packets, and sending
arbitrary raw packets with specified types and destinations.
These functions are primarily intended for testing purposes
and rely on the `send-raw-packet-downstream` command provided
by NetworkStack.
Test: atest NetworkStaticLibHostPythonTests
Bug: 335368434
Change-Id: Iae7879bf92e1dda8fbd32b92ff166e82c87593c7
This commit adds the necessary code for 'adb_utils' to enable APF
multi-device testing which will be introduced in follow-up patches.
This includes utilities of issuing shell command, parsing dumpsys
key-value pairs, controlling doze mode and screen state.
Additionally, unit tests are added to verify the basic functionality.
Test: atest NetworkStaticLibHostPythonTests
Bug: 335368434
Change-Id: I580e91b494580ec9105c8988972845d38c104031
Added a CTS test case to verify APFv6 implementation by sending an
ICMPv6 ping request with a 56-byte payload. The reply was expected to be
dropped by the APF program. The APF program was expected to sent another
ICMPv6 ping request with a 1-byte payload. The reply was expected to be
accepted by the APF program. Finally, The test confirms if the second
ping reply is received.
Test: TH
Change-Id: I322e7c0674ac9df60579d9e6d44690e383004d36