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
Use the following commands to apply pyformat
pyformat -i -r --force_quote_type single staticlibs/
pyformat -i -r --force_quote_type single tests/
Flag: EXEMPT mainline
Bug: 419423721
Test: TH
Change-Id: I0d3914ec652664ed4ec5d44afc25d97ff8bb4626
This change corrects a missing function error, which was renamed in aosp/3545962.
Test: atest NetworkStaticLibHostPythonTests
Change-Id: I2f51702adfa48f2207ef4dd79f641c8f57d15ac7
The 'ip link show' requires root permissions, causing errors.
This change replaces 'ip link show' with 'ip link'.
Bug: 401123634
Test: atest NetworkStaticLibHostPythonTests
Change-Id: I82b219ae9179f23e3233f797aeb4aa3740e6d3ec
This removes the need of pip install absl-py and
virtual env usage from the tests.
Test: atest NetworkStaticLibHostPythonTests
Bug: N/A
Change-Id: I2259f7702ecc6b5e7b7b23e2bf44fa28a5a2e07b
This is a no-op refactoring, which is preparation for follow-up
changes to add more apf tests.
This includes:
1. Add a method to send packet and expect counter increases.
2. Inline the packet construction code in the test method.
Test: atest NetworkStaticLibHostPythonTests
Test: m connectivity_multi_devices_snippet && \
atest CtsConnectivityMultiDevicesTestCases
Bug: 350880989
Change-Id: Iadcfd97740033306af1b6a474004cbf0699ddd1b
This is a no-op refactoring, which is preparation for follow-up
changes to add more apf test classes.
This includes:
1. Move initialization code to a base class, which setup a hotspot
and a client connects to it, and enable doze mode to
activate the apf.
2. Check whether send raw packet is supported before testing.
Test: m connectivity_multi_devices_snippet && \
atest CtsConnectivityMultiDevicesTestCases
Test: atest NetworkStaticLibHostPythonTests
Bug: 350880989
Change-Id: I6376935883653182728e473e2f5533407d993d7b
This utility reads output of cmd network_stack apf ${iface_name}
capabilities. This is needed for the tests to skip if the apf
version is too old.
Test: atest NetworkStaticLibHostPythonTests
Bug: 352132428
Change-Id: I1f8b523c3e6f687c2e919993bc18392dc25dbbf7
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 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