From da1ae8dca5c7838b98a6042efe2f50eb142ec0da Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Wed, 12 Feb 2025 12:51:39 +0100 Subject: [PATCH] tests: bsim: bluetooth: Test with CONFIG_BT_LONG_WQ disabled Change adds bsim tests with CONFIG_BT_LONG_WQ=n to ensure correct behavior. Change uses host/gatt/ccc_store test. Change also switches to using more unique simulation ID in the test scripts. Signed-off-by: Marek Pieta --- .../gatt/ccc_store/overlay-no_long_wq.conf | 2 + .../test_scripts/ccc_store_no_long_wq.sh | 41 +++++++++++++++++++ ...rite.sh => ccc_store_no_store_on_write.sh} | 2 +- .../host/gatt/ccc_store/testcase.yaml | 7 +++- 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 tests/bsim/bluetooth/host/gatt/ccc_store/overlay-no_long_wq.conf create mode 100755 tests/bsim/bluetooth/host/gatt/ccc_store/test_scripts/ccc_store_no_long_wq.sh rename tests/bsim/bluetooth/host/gatt/ccc_store/test_scripts/{ccc_no_store_on_write.sh => ccc_store_no_store_on_write.sh} (96%) diff --git a/tests/bsim/bluetooth/host/gatt/ccc_store/overlay-no_long_wq.conf b/tests/bsim/bluetooth/host/gatt/ccc_store/overlay-no_long_wq.conf new file mode 100644 index 00000000000..baebf9ca980 --- /dev/null +++ b/tests/bsim/bluetooth/host/gatt/ccc_store/overlay-no_long_wq.conf @@ -0,0 +1,2 @@ +# Disable the dedicated workqueue for long-running tasks. +CONFIG_BT_LONG_WQ=n diff --git a/tests/bsim/bluetooth/host/gatt/ccc_store/test_scripts/ccc_store_no_long_wq.sh b/tests/bsim/bluetooth/host/gatt/ccc_store/test_scripts/ccc_store_no_long_wq.sh new file mode 100755 index 00000000000..cad38e56e52 --- /dev/null +++ b/tests/bsim/bluetooth/host/gatt/ccc_store/test_scripts/ccc_store_no_long_wq.sh @@ -0,0 +1,41 @@ +#!/bin/env bash +# Copyright 2025 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +source ${ZEPHYR_BASE}/tests/bsim/sh_common.source + +test_exe="bs_${BOARD_TS}_$(guess_test_long_name)_overlay-no_long_wq_conf" +simulation_id="ccc_store_no_long_wq" +verbosity_level=2 +EXECUTE_TIMEOUT=60 + +cd ${BSIM_OUT_PATH}/bin + +if [ "${1}" != 'debug0' ]; then + Execute "./${test_exe}" \ + -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=central \ + -flash="${simulation_id}_client.log.bin" -flash_rm -RealEncryption=1 -argstest 10 +fi + +if [ "${1}" != 'debug1' ]; then + Execute "./${test_exe}" \ + -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=peripheral \ + -flash="${simulation_id}_server.log.bin" -flash_rm -RealEncryption=1 -argstest 10 +fi + +Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} \ + -D=2 -sim_length=60e6 + +if [ "${1}" == 'debug0' ]; then + gdb --args "./${test_exe}" \ + -v=${verbosity_level} -s=${simulation_id} -d=0 -testid=central \ + -flash="${simulation_id}_client.log.bin" -flash_rm -RealEncryption=1 -argstest 10 +fi + +if [ "${1}" == 'debug1' ]; then + gdb --args "./${test_exe}" \ + -v=${verbosity_level} -s=${simulation_id} -d=1 -testid=peripheral \ + -flash="${simulation_id}_server.log.bin" -flash_rm -RealEncryption=1 -argstest 10 +fi + +wait_for_background_jobs diff --git a/tests/bsim/bluetooth/host/gatt/ccc_store/test_scripts/ccc_no_store_on_write.sh b/tests/bsim/bluetooth/host/gatt/ccc_store/test_scripts/ccc_store_no_store_on_write.sh similarity index 96% rename from tests/bsim/bluetooth/host/gatt/ccc_store/test_scripts/ccc_no_store_on_write.sh rename to tests/bsim/bluetooth/host/gatt/ccc_store/test_scripts/ccc_store_no_store_on_write.sh index 97b6631b1a4..b732d1c598f 100755 --- a/tests/bsim/bluetooth/host/gatt/ccc_store/test_scripts/ccc_no_store_on_write.sh +++ b/tests/bsim/bluetooth/host/gatt/ccc_store/test_scripts/ccc_store_no_store_on_write.sh @@ -5,7 +5,7 @@ source ${ZEPHYR_BASE}/tests/bsim/sh_common.source test_exe="bs_${BOARD_TS}_$(guess_test_long_name)_overlay-no_store_on_write_conf" -simulation_id="ccc_no_store_on_write" +simulation_id="ccc_store_no_store_on_write" verbosity_level=2 EXECUTE_TIMEOUT=60 diff --git a/tests/bsim/bluetooth/host/gatt/ccc_store/testcase.yaml b/tests/bsim/bluetooth/host/gatt/ccc_store/testcase.yaml index 12ab2fc7036..a2ee367de1a 100644 --- a/tests/bsim/bluetooth/host/gatt/ccc_store/testcase.yaml +++ b/tests/bsim/bluetooth/host/gatt/ccc_store/testcase.yaml @@ -10,8 +10,13 @@ tests: bluetooth.host.gatt.ccc_store: harness_config: bsim_exe_name: tests_bsim_bluetooth_host_gatt_ccc_store_prj_conf - bluetooth.host.gatt.ccc_store_2: + bluetooth.host.gatt.ccc_store_no_store_on_write: harness_config: bsim_exe_name: tests_bsim_bluetooth_host_gatt_ccc_store_overlay-no_store_on_write_conf extra_args: EXTRA_CONF_FILE=overlay-no_store_on_write.conf + bluetooth.host.gatt.ccc_store_no_long_wq: + harness_config: + bsim_exe_name: tests_bsim_bluetooth_host_gatt_ccc_store_overlay-no_long_wq_conf + extra_args: + EXTRA_CONF_FILE=overlay-no_long_wq.conf