-
Notifications
You must be signed in to change notification settings - Fork 7.8k
tests: Bluetooth: Add BT Tester GAP smoke test #86146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,5 @@ | ||
/* SPDX-License-Identifier: Apache-2.0 */ | ||
|
||
&uart0 { | ||
hw-flow-control; | ||
}; |
18 changes: 18 additions & 0 deletions
18
tests/bluetooth/tester/boards/nrf5340bsim_nrf5340_cpuapp.conf
This file contains hidden or 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,18 @@ | ||
# 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 | ||
CONFIG_UART_INTERRUPT_DRIVEN=y | ||
|
||
CONFIG_SERIAL=y |
6 changes: 6 additions & 0 deletions
6
tests/bluetooth/tester/boards/nrf5340bsim_nrf5340_cpuapp.overlay
This file contains hidden or 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,6 @@ | ||
/* SPDX-License-Identifier: Apache-2.0 */ | ||
|
||
&uart0 { | ||
compatible = "nordic,nrf-uarte"; | ||
hw-flow-control; | ||
}; |
This file contains hidden or 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 |
---|---|---|
|
@@ -7,6 +7,9 @@ | |
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef TESTS_BLUETOOTH_TESTER_SRC_BTP_ | ||
#define TESTS_BLUETOOTH_TESTER_SRC_BTP_ | ||
|
||
#include <zephyr/sys/util.h> | ||
#include <zephyr/bluetooth/addr.h> | ||
|
||
|
@@ -87,6 +90,8 @@ | |
|
||
#define BTP_STATUS_VAL(err) (err) ? BTP_STATUS_FAILED : BTP_STATUS_SUCCESS | ||
|
||
#define BTP_EVENT_OPCODE 0x80 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
/* TODO indicate delay response, should be removed when all commands are | ||
* converted to cmd+status+ev pattern | ||
*/ | ||
|
@@ -104,3 +109,5 @@ struct btp_hdr { | |
struct btp_status { | ||
uint8_t code; | ||
} __packed; | ||
|
||
#endif /* TESTS_BLUETOOTH_TESTER_SRC_BTP_ */ |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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) | ||
|
||
# This contains babblesim-specific helpers, e.g. device synchronization. | ||
add_subdirectory(${ZEPHYR_BASE}/tests/bsim/babblekit babblekit) | ||
target_link_libraries(app PRIVATE babblekit) | ||
|
||
zephyr_include_directories( | ||
${BSIM_COMPONENTS_PATH}/libUtilv1/src/ | ||
${BSIM_COMPONENTS_PATH}/libPhyComv1/src/ | ||
) | ||
|
||
zephyr_include_directories( | ||
src/ | ||
${ZEPHYR_BASE}/tests/bluetooth/tester/src | ||
${ZEPHYR_BASE}/tests/bluetooth/tester/src/btp | ||
${ZEPHYR_BASE}/tests/bluetooth/tester/src/audio/btp | ||
) | ||
|
||
target_sources(app PRIVATE | ||
src/bsim_btp.c | ||
src/test_main.c | ||
src/host/gap_central.c | ||
src/host/gap_peripheral.c | ||
) |
This file contains hidden or 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,8 @@ | ||
# Copyright (c) 2025 Nordic Semiconductor ASA | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
module = BSIM_BTTESTER | ||
module-str = bsim_bttester | ||
source "subsys/logging/Kconfig.template.log_config" | ||
|
||
source "Kconfig.zephyr" |
This file contains hidden or 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,5 @@ | ||
/* SPDX-License-Identifier: Apache-2.0 */ | ||
|
||
&uart0 { | ||
hw-flow-control; | ||
}; |
This file contains hidden or 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,21 @@ | ||
#!/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 | ||
|
||
source ${ZEPHYR_BASE}/tests/bsim/compile.source | ||
|
||
: "${ZEPHYR_BASE:?ZEPHYR_BASE must be set to point to the zephyr root directory}" | ||
|
||
# We only want to build the tests/bsim/bluetooth/tester/ application for the nrf52_bsim/native board | ||
# as we do not gain anything from running this application for the nrf5340bsim_nrf5340_cpuapp and | ||
# it is not worth the added complexity to run it with anything but nrf52_bsim/native | ||
west twister -T ${ZEPHYR_BASE}/tests/bsim/bluetooth/tester/ | ||
aescolar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
west twister -p ${BOARD} -T ${ZEPHYR_BASE}/tests/bluetooth/tester/ | ||
|
||
wait_for_background_jobs |
This file contains hidden or 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,14 @@ | ||
CONFIG_ASSERT=y | ||
CONFIG_THREAD_NAME=y | ||
|
||
# Should not be necessary, but the bluetooth/buf.h header file require Bluetooth to be enabled, and | ||
# the header file is being included by some of the BTP header files | ||
CONFIG_BT=y | ||
|
||
CONFIG_UART_PIPE=n | ||
CONFIG_SERIAL=y | ||
|
||
CONFIG_LOG=y | ||
CONFIG_LOG_FUNC_NAME_PREFIX_ERR=y | ||
CONFIG_LOG_FUNC_NAME_PREFIX_WRN=y | ||
CONFIG_BSIM_BTTESTER_LOG_LEVEL_DBG=y |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.