Skip to content
Snippets Groups Projects
Commit 3dfb5f8a authored by Jack He's avatar Jack He
Browse files

RFCOMM: Add unit tests for connection scenarios

Unit tests:
* Add net_test_stack_rfcomm
* Use a compiler trick to compile production RFCOMM code against L2CAP
  and BTM header, but fake L2CAP and BTM source code so that we can stub
  statically defined L2CAP and BTM code using mocks
* Rename net_test_rfcomm to net_test_rfcomm_suite
* Add mocked L2CAP and BTM layer to allow packet replay from L2CAP layer
  to RFCOMM layer in order to reproduce time dependent issues such as
  connection collision
* Add a number of utility methods that generates RFCOMM packet bytes
  using supported parameters
* Add unit test for above utility methods
* Add suite of unit tests named StackRfcommTest, including:
 - SingleServerConnectionHelloWorld
 - MultiServerPortSameDeviceHelloWorld
 - SameServerPortMultiDeviceHelloWorld
 - SingleClientConnectionHelloWorld
 - SameClientPortMultiDeviceHelloWorld
* These tests supply L2CAP packets and API calls to trigger RFCOMM
  connection setup in various scenarios
* Added logging method to output debug log via VLOG(1) logging level and
  allow compile time configuration of these logs through a constant flag

Bug: 77224743
Test: ./test/run_unit_tests.sh net_test_stack_rfcomm
      testplans/details/158641/3975
Change-Id: I9d59843603cd36394c3736670bcf3c39dea26674
parent 549ae8b2
No related branches found
No related tags found
No related merge requests found
Showing
with 1967 additions and 3 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment