Skip to content

tests: bluetooth: classic: Add test suite l2cap. #88703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CC0918
Copy link

@CC0918 CC0918 commented Apr 16, 2025

IUT works as a l2cap server with basic mode. The peer device, l2cap client with basic mode, is a PC with running bumble on it. This test only performs the function of L2CAP basic mode.

Support multiple l2cap enerties in new shell l2cap_br, which may support more test function.

In the test suite, there are two groups in test cases.

Group 1 Including case1-case8 focuses on connection and disconnection around l2cap. The impact of active and passive acl connectivity, disconnectivity and authentication as well as disconnection from ACL without l2cap disconnect is tested.

Group2 Including case9-case14 revolves around the basic parameters of L2CAPserver configuration, data transfer.
Case 9: Test l2cap connection with max MTU(0xffff). But the max mtu which the stack supports is (CONFIG_BT_BUF_ACL_RX_SIZE - 4U = 196).
Case 10: Test l2cap connection with min MTU(0x30).
Case 11: Test l2cap connection with invaild PSM.
Case 12: Test l2cap multi_channel connection and data tranfer.
Case 13: Stress Test. Repeat l2cap connect, disconnect operation.
Case 14: Stress Test. Repeat data transfer operation in a single connection.
In Case 13 and 14, if enlarging STRESS_TEST_MAX_COUNT and test fail, you can enlarge timeout in testcase.yml.

test_l2cap_server.py is a file containing real test cases. test_l2cap_common.py is a common file. It encapsulates some test function functions that are commonly used for test cases.

@kartben kartben requested a review from Copilot April 17, 2025 16:10
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 10 changed files in this pull request and generated no comments.

Files not reviewed (5)
  • tests/bluetooth/classic/l2cap/CMakeLists.txt: Language not supported
  • tests/bluetooth/classic/l2cap/README.rst: Language not supported
  • tests/bluetooth/classic/l2cap/boards/mimxrt1170_evk_mimxrt1176_cm7_B.conf: Language not supported
  • tests/bluetooth/classic/l2cap/boards/mimxrt1170_evk_mimxrt1176_cm7_B.overlay: Language not supported
  • tests/bluetooth/classic/l2cap/prj.conf: Language not supported
Comments suppressed due to low confidence (1)

tests/bluetooth/classic/l2cap/pytest/test_l2cap_common.py:24

  • [nitpick] The variable 'Mode' is defined with an initial capital letter despite being a constant value; consider renaming it to 'MODE' to maintain standard naming conventions for constants.
L2CAP_SERVER_PSM=0x1001
Mode="basic"

@CC0918 CC0918 force-pushed the main_l2cap_test branch 13 times, most recently from cd4d435 to 2a141fe Compare April 24, 2025 01:40
* tests: bluetooth: classic:  Add test suite l2cap.

IUT works as a l2cap server with basic mode. The peer device,
l2cap client with basic mode, is a PC with running `bumble` on it.
This test only performs the function of L2CAP basic mode.
Support multiple l2cap enerties in new shell l2cap_br,
which may support more test function.

In the test suite , there are two groups in test cases.
Group 1 Including case1-case8 focuses on connection and
disconnection around l2cap. The impact of active and passive
acl connectivity, disconnectivity and authentication as well as
disconnection from ACL without l2cap disconnect is tested.

Group2 Including case9-case14 revolves around the basic
 parameters of L2CAPserver configuration, data transfer.
Case 9:   Test l2cap connection with max MTU(0xffff).But the max mtu
which the stack supports is (CONFIG_BT_BUF_ACL_RX_SIZE - 4U = 196).
Case 10: Test l2cap connection with min MTU(0x30).
Case 11: Test l2cap connection with invaild PSM.
Case 12: Test l2cap multi_channel connection and data tranfer.
Case 13: Stress Test. Repeat l2cap connect, disconnect operation.
Case 14: Stress Test. Repeat data transfer in a single connection.
In Case 13 and 14, if enlarging STRESS_TEST_MAX_COUNT and test fail,
you can enlarge timeout in  testcase.yml.

test_l2cap_server.py is a file containing real test cases.
test_l2cap_common.py is a common file. It encapsulates some
test function functions that are commonly used for test cases.

Signed-off-by: Cheng Chang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants