Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 53c559af 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
Merged-In: I9d59843603cd36394c3736670bcf3c39dea26674
(cherry picked from commit 9b423ecfc85f22d355d9f10b347083f9d9bfe02d)
parent 75517219
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment