diff --git a/tests/bsim/bluetooth/mesh/prj_mesh1d1.conf b/tests/bsim/bluetooth/mesh/prj_mesh1d1.conf index 15df7b8a5d37322..994af8bfb7e0a44 100644 --- a/tests/bsim/bluetooth/mesh/prj_mesh1d1.conf +++ b/tests/bsim/bluetooth/mesh/prj_mesh1d1.conf @@ -25,6 +25,7 @@ CONFIG_BT_MESH_TX_SEG_MAX=32 CONFIG_BT_MESH_RX_SEG_MAX=32 CONFIG_BT_MESH_TX_SEG_MSG_COUNT=10 CONFIG_BT_MESH_RX_SEG_MSG_COUNT=10 +CONFIG_BT_MESH_SEG_BUFS=100 CONFIG_BT_MESH_CFG_CLI=y CONFIG_BT_MESH_MODEL_GROUP_COUNT=3 CONFIG_BT_MESH_LOW_POWER=y diff --git a/tests/bsim/bluetooth/mesh/src/test_op_agg.c b/tests/bsim/bluetooth/mesh/src/test_op_agg.c index 85bc1a6ba26013f..d8bb50b3fd39b04 100644 --- a/tests/bsim/bluetooth/mesh/src/test_op_agg.c +++ b/tests/bsim/bluetooth/mesh/src/test_op_agg.c @@ -257,6 +257,23 @@ static void test_dut_model_coex(void) PASS(); } +static void test_dut_model_coex_loopback(void) +{ + /* Start an aggregated sequence */ + common_init(SRV_ADDR, SRV_ADDR, true); + + /* Send aggregated sequence to server model over loopback */ + ASSERT_OK(bt_mesh_op_agg_cli_seq_send()); + + /* Confirm incoming sequence messages */ + confirm_agg_seq(); + + /* Confirm status messages for sequence */ + confirm_agg_status(); + + PASS(); +} + #define TEST_CASE(role, name, description) \ { \ .test_id = "op_agg_" #role "_" #name, \ @@ -273,6 +290,7 @@ static const struct bst_test_instance test_op_agg[] = { TEST_CASE(srv, max_len_status_msg_send, "OpAggSrv will respond with a 380 Byte status message. "), TEST_CASE(dut, model_coex, "DUT: Coexistence of OpAggSrv and OpAggCli."), + TEST_CASE(dut, model_coex_loopback, "DUT: Coexistence for OpAggSrv and OpAggCli loopback."), BSTEST_END_MARKER}; diff --git a/tests/bsim/bluetooth/mesh/tests_scripts/op_agg/loopback.sh b/tests/bsim/bluetooth/mesh/tests_scripts/op_agg/loopback.sh new file mode 100755 index 000000000000000..3a4720bdaf4dd81 --- /dev/null +++ b/tests/bsim/bluetooth/mesh/tests_scripts/op_agg/loopback.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# Copyright 2023 Nordic Semiconductor +# SPDX-License-Identifier: Apache-2.0 + +source $(dirname "${BASH_SOURCE[0]}")/../../_mesh_test.sh + +# Test that an Opcode aggregated message can be sent and received on loopback. +# +# Test procedure: +# 1. The device initializes both Opcode aggregator server and client. +# The device starts an Opcode aggregator sequence and populates the buffer. +# 2. The device starts sending the sequence on loopback. +# 3. The device verifies that the sequence is correctly received by the server model. +# 4. The device confirms that the client model received all status messages. +conf=prj_mesh1d1_conf +RunTest mesh_op_agg_model_coex_loopback \ + op_agg_dut_model_coex_loopback + +conf=prj_mesh1d1_conf +overlay=overlay_psa_conf +RunTest mesh_op_agg_model_coex_loopback \ + op_agg_dut_model_coex_loopback