-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Bluetooth: Add BT Tester GAP smoke test
Add a babblesim test of the BT Tester doing a GAP smoke test connecting 2 BT testers using BTP. The purpose of this is to further increase the test coverage of the BT Tester in CI, as it is only being built, and runtime errors are typically not caught. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
- Loading branch information
Showing
25 changed files
with
643 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# CONFIG_TEST enforces minimal logging, which we don't want | ||
CONFIG_TEST=n | ||
|
||
CONFIG_ASSERT=y | ||
CONFIG_THREAD_NAME=y | ||
|
||
CONFIG_LOG=y | ||
CONFIG_LOG_BACKEND_SHOW_COLOR=y | ||
CONFIG_LOG_FUNC_NAME_PREFIX_ERR=y | ||
CONFIG_LOG_FUNC_NAME_PREFIX_WRN=y | ||
|
||
CONFIG_LOG_DEFAULT_LEVEL=3 | ||
CONFIG_BTTESTER_LOG_LEVEL_DBG=y | ||
|
||
CONFIG_UART_PIPE=n |
15 changes: 15 additions & 0 deletions
15
tests/bluetooth/tester/boards/nrf5340bsim_nrf5340_cpuapp.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# CONFIG_TEST enforces minimal logging, which we don't want | ||
CONFIG_TEST=n | ||
|
||
CONFIG_ASSERT=y | ||
CONFIG_THREAD_NAME=y | ||
|
||
CONFIG_LOG=y | ||
CONFIG_LOG_BACKEND_SHOW_COLOR=y | ||
CONFIG_LOG_FUNC_NAME_PREFIX_ERR=y | ||
CONFIG_LOG_FUNC_NAME_PREFIX_WRN=y | ||
|
||
CONFIG_LOG_DEFAULT_LEVEL=3 | ||
CONFIG_BTTESTER_LOG_LEVEL_DBG=y | ||
|
||
CONFIG_UART_PIPE=n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
cmake_minimum_required(VERSION 3.20.0) | ||
|
||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) | ||
project(tester_bsim) | ||
|
||
# Add the BSIM tester | ||
add_subdirectory(${ZEPHYR_BASE}/tests/bluetooth/tester ${CMAKE_BINARY_DIR}/tester_build) | ||
|
||
# This contains babblesim-specific helpers, e.g. device synchronization. | ||
add_subdirectory(${ZEPHYR_BASE}/tests/bsim/babblekit babblekit) | ||
target_link_libraries(app PRIVATE babblekit) | ||
|
||
# Add the testlib | ||
add_subdirectory(${ZEPHYR_BASE}/tests/bluetooth/common/testlib testlib) | ||
target_link_libraries(app PRIVATE testlib) | ||
|
||
zephyr_include_directories( | ||
${BSIM_COMPONENTS_PATH}/libUtilv1/src/ | ||
${BSIM_COMPONENTS_PATH}/libPhyComv1/src/ | ||
) | ||
|
||
target_sources(app PRIVATE | ||
src/btp.c | ||
src/gap_central.c | ||
src/gap_peripheral.c | ||
src/test_main.c | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright (c) 2024-2025 Nordic Semiconductor ASA | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
source "${ZEPHYR_BASE}/tests/bluetooth/tester/Kconfig" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright (c) 2023-2025 Nordic Semiconductor ASA | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
source "${ZEPHYR_BASE}/tests/bluetooth/tester/Kconfig.sysbuild" | ||
|
||
config NATIVE_SIMULATOR_PRIMARY_MCU_INDEX | ||
int | ||
# Let's pass the test arguments to the application MCU test | ||
# otherwise by default they would have gone to the net core. | ||
default 0 if $(BOARD_TARGET_STRING) = "NRF5340BSIM_NRF5340_CPUAPP" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
# Copyright 2025 Nordic Semiconductor ASA | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Compile all the applications needed by the bsim tests in these subfolders | ||
|
||
#set -x #uncomment this line for debugging | ||
set -ue | ||
|
||
: "${ZEPHYR_BASE:?ZEPHYR_BASE must be set to point to the zephyr root directory}" | ||
|
||
west twister -T ${ZEPHYR_BASE}/tests/bsim/bluetooth/tester/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Please build using the sample configuration file: | ||
# ${ZEPHYR_BASE}/tests/bluetooth/tester/prj.conf |
Oops, something went wrong.