tree: a282db0d600f343f043214e1881fe32d3d2305e5 [path history] [tgz]
  1. meta/
  2. src/
  3. BUILD.gn
  4. README.md
src/connectivity/bluetooth/testing/mock-piconet-server/README.md

Mock Piconet Server

The Mock Piconet Server (MPS) component is used in integration tests for the Bluetooth profiles.

The server manages a fake piconet of peers, and simulates the behavior of the Profile Server. The component implements the ProfileTest protocol, which can be used to register mock peers in the piconet, launch profiles to test, and drive peer behavior. The server supports establishing L2CAP connections. For RFCOMM connections, test writers should use the RFCOMM component as an intermediary.

Build Configuration

To include the mock piconet server and its tests in your build, add:

--with //src/connectivity/bluetooth/testing/mock-piconet-server and --with //src/connectivity/bluetooth/testing/mock-piconet-server:tests to your fx set.

To run the unit tests for the server: fx test mock-piconet-server-tests.

The Mock Piconet Server is referenced using a relative URL. Make sure to include the MPS component in the deps of your integration test package.

Library

The Mock Piconet Server provides a client-facing library of utilities to launch and interact with the server. To use the tools provided in the library, add //src/connectivity/bluetooth/testing/mock-piconet-server:lib to the BUILD.gn of your test component.

Examples

Import the PiconetHarness to your test to get started. Define the topology by adding profiles-under-test or mock piconet members to be driven by the test code. Use the client library to route capabilities needed & exposed by the test. Check out the AVRCP Integration Tests for an example.