zephyr/tests/bsim/bluetooth/host/misc/sample_test
Håvard Reierstad 7737483c06 Bluetooth: Host: More bsim refactoring
Commit does the following changes:
* Use functionality from the `babbelkit` library for common functions
  related to flags, test progression (failing, passing etc.) and
  synchronization between two devices. Locally defined equivalents are
  removed.
* Removes the files containing only functionality that is provided
  by the `babblekit` library.
* Remove the `test_pre_init_f` and `test_tick_f` functions (commonly
  implemented as `test_init` and `test_tick`) from the modified tests.
  These functions are not needed as they were only used to fail the test
  if a device didn't complete the test within a certain time frame. This
  is already handled by the `sim_length` argument used in the test
  scripts.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2025-02-12 09:40:07 +01:00
..
src
test_scripts
CMakeLists.txt
prj.conf
README.rst
testcase.yaml

.. _bluetooth_bsim_test_sample:

Bluetooth: Example BabbleSim test
#################################

Abstract
********

This test's purpose is to serve as template for implementing a new BabbleSim Bluetooth test.

BabbleSim_ is :ref:`integrated in zephyr <bsim>` and used for testing the Bluetooth stack.
The tests are implemented in ``tests/bsim/bluetooth``.
They can only be run on Linux.

This sample test uses the ``testlib`` (:zephyr_file:`tests/bluetooth/common/testlib/CMakeLists.txt`)
test library, in order to de-duplicate code that is not relevant to the test in question. Things
like setting up a connection, getting the GATT handle of a characteristic, etc..

Please don't use the ``bs_`` prefix in files or identifiers. It's meant to
namespace the babblesim simulator code.

Reading guide
*************

Read in order:

1. The :ref:`Bsim test documentation <bsim>`.
#. ``test_scripts/run.sh``
#. ``CMakeLists.txt``
#. ``src/dut.c`` and ``src/peer.c``
#. ``src/main.c``

.. _BabbleSim:
   https://BabbleSim.github.io