Skip to content

Commit

Permalink
tests: Bluetooth: Mesh: Op_agg coex loopback test
Browse files Browse the repository at this point in the history
Adds coexistence Bsim test for Opcode Aggregator models using loopback.
The test verifies that the Opcode Aggregator server and client can send
messages to each other on the loopback interface.

Signed-off-by: Anders Storrø <[email protected]>
  • Loading branch information
Andrewpini authored and carlescufi committed Oct 20, 2023
1 parent fc152c8 commit fe9ffda
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/bsim/bluetooth/mesh/prj_mesh1d1.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions tests/bsim/bluetooth/mesh/src/test_op_agg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand All @@ -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};

Expand Down
22 changes: 22 additions & 0 deletions tests/bsim/bluetooth/mesh/tests_scripts/op_agg/loopback.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit fe9ffda

Please sign in to comment.