1#!/usr/bin/env bash
2# Copyright 2024 Nordic Semiconductor
3# SPDX-License-Identifier: Apache-2.0
4
5source $(dirname "${BASH_SOURCE[0]}")/../../_mesh_test.sh
6
7# This test verifies that Subnet Bridge stops bridging messages when the Subnet Bridge state is
8# disabled.
9#
10# 3 roles are used in this test: Tester (Tester), Subnet Bridge node, and Mesh node.
11#
12# Subnets topology*:
13#           Tester
14#             |
15#         (subnet 0)
16#            |
17#       Subnet Bridge (bridges subnets 0 <-> 1, 0 <-> 2)
18#        /         \
19#    (subnet 1)  (subnet 2)
20#       |          |
21#     Node       Node
22#
23# (*) - All nodes are in the tester's range
24#
25# Test procedure:
26# 1. Tester configures itself and creates subnets equal to number of non-bridge nodes.
27# 2. Tester provisions and configures Subnet Bridge node to bridge the subnets.
28# 3. Tester provisions and configures non-bridge nodes for each subnet.
29# 4. Tester sends a DATA message to each node encrypted with primary key.
30# 5. Nodes store the received messages.
31# 6. Tester sends a GET message to each node encrypted with primary key.
32# 7. Nodes send the stored messages back to the tester through a STATUS message encrypted
33# with the key of the subnets they are provisioned to.
34# 8. Tester verifies that each node received messages.
35# 9. Tester disables Subnet Bridge state.
36# 10. Tester sends a DATA message to each node encrypted with primary key.
37# 11. Tester sends a GET message to each node encrypted with primary key.
38# 12. Tester verifies that each node didn't receive DATA messages.
39
40RunTest mesh_brg_simple \
41	brg_tester_simple brg_bridge_simple brg_device_simple brg_device_simple
42
43overlay=overlay_psa_conf
44RunTest mesh_brg_simple_psa \
45	brg_tester_simple brg_bridge_simple brg_device_simple brg_device_simple
46