Commit graph android_packages_modules_Co.../staticlibs/testutils/host/python
Message SHA1
Add get ipv4/ipv6 address function to apf_utils
Test: atest NetworkStaticLibHostPythonTests
Change-Id: I535bdca481f600b95603206bf368a106cbb45b42

Jimi Chen   commited 2024-09-20 05:45:19 +00:00
b756497e05
Add packet_utils for multi-devices tests
Test: atest NetworkStaticLibHostPythonTests
Change-Id: I211d071232d1730c043eef29e1bf2bce27a6e2a6

Jimi Chen   commited 2024-09-20 05:41:20 +00:00
0e1c1cc92d
Check APF version, VSR API level, and Android version
This commit introduces checks for APF version, VSR API level,
and Android version to decide whether an APFv4 test should be
run, skipped, or fail:
* If Android version is less than V, skip the test
* If VSR API level is greater than or equal to 14 and APF
  version is less than 4, fail the test
* Otherwise, if APF version is less than 4, skip the test

Test: m connectivity_multi_devices_snippet && \
      atest CtsConnectivityMultiDevicesTestCases:ConnectivityMultiDevicesTest
Fix: 352132428
Change-Id: I023164fb59ad40f489abea2e0c45761efc39699b

Junyu Lai   commited 2024-09-10 18:06:28 +08:00
73711f7b41
Setup Wi-Fi P2P connection
Add functionalities to setup Wi-Fi P2P connection for subsequent
Wi-Fi P2P mDns tests

Bug: 343311941
Test: atest CtsConnectivityMultiDevicesTestCases
Change-Id: I060509deb32c078829c1108f9ae2a29561e00d53

Paul Hu   commited 2024-08-13 07:20:21 +00:00
3e24dec82a
Refactor Drop EtherCat packet test
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

Junyu Lai   commited 2024-08-01 03:32:19 +00:00
6f6b1a4684
Refactor ApfV4Test
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

Junyu Lai   commited 2024-08-01 03:32:19 +00:00
cf655869ba
Move apf test to a standalone file
This is a no-op refactoring, which is preparation for follow-up
changes to add more apfv4 tests.

This includes:
  1. Add a entry point for multi-device tests to collect
     test cases from different files.
  2. Move multi-device initialization code to a base class.
  3. Make different test classes inherit the base class.

Test: m connectivity_multi_devices_snippet && \
      atest CtsConnectivityMultiDevicesTestCases
Bug: 350880989
Change-Id: I294c85d8e09633bbf02ba1543b9f2ea3e988e20d

Junyu Lai   commited 2024-08-01 03:32:19 +00:00
32a2d151cc
Add wifip2p_utils and Wifip2pMultiDevicesSnippet
Add wifip2p_utils and Wifip2pMultiDevicesSnippet for subsequent
Wi-Fi P2P mDns tests

Bug: 343311941
Test: atest CtsConnectivityMultiDevicesTestCases
Change-Id: Icfdea97595292e024269e789673e3b1e23aa37ee

Paul Hu   commited 2024-07-16 08:51:41 +00:00
f5020471fe
Merge "Add SDK check for mdns test" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-07-15 09:39:01 +00:00
30a22238d1
Add SDK check for mdns test
The mDNS test should be conducted with an SDK version higher
than Android T (align with NsdManagerTest CTS, as NsdManager is
only updatable on T+). Add an SDK version precondition check to
ensure both devices are available for testing.

Bug: 343311941
Test: atest CtsConnectivityMultiDevicesTestCases
Change-Id: Id5505b5d0746515689dc1646116a16fcfb8ece64

Paul Hu   commited 2024-07-15 08:53:31 +00:00
e7fd5a53e1
Support get apf capabilities from network_stack shell command
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

Junyu Lai   commited 2024-07-11 17:43:21 +08:00
c6fae35cfd
Remove packet type and dst mac when sending raw packet
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

Junyu Lai   commited 2024-07-03 12:33:11 +08:00
161dc10f60
Add support for sending raw packets
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

Junyu Lai   commited 2024-07-01 16:53:50 +08:00
4a1baf042b
Add apf_utils for multi-device tests
Test: atest NetworkStaticLibHostPythonTests
Bug: 335368434
Change-Id: I79064abcb88fbcee00ec9ec998ba5a3e2d3478a6

Junyu Lai   commited 2024-07-01 13:44:12 +08:00
b0f759c42a
Add adb_utils for multidevice test
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

Junyu Lai   commited 2024-07-01 13:33:13 +08:00
bed4480ffd
Add assert_utils for multidevice test
Test: atest NetworkStaticLibHostPythonTests
Bug: 335368434
Change-Id: I2a9ee97b84cb16791c0c5e3cb03120e67ffeb0af

Junyu Lai   commited 2024-07-01 12:23:59 +08:00
850e6fae54
Move utils to staticlib
This is a no-op refactoring.

Test: m connectivity_multi_devices_snippet && \
      atest CtsConnectivityMultiDevicesTestCases
Bug: 335368434
Change-Id: I415cc22f49c437be6fe8e8ae8822af22ebefe8d1

Junyu Lai   commited 2024-06-28 11:19:54 +08:00
79b771f9bb