1#!/usr/bin/env bash
2# Copyright 2022 Nordic Semiconductor
3# SPDX-License-Identifier: Apache-2.0
4
5source $(dirname "${BASH_SOURCE[0]}")/../../_mesh_test.sh
6
7# Test fragmentation of RPL:
8# 1. Send a message from 3 different consecutive nodes starting from address 100;
9# 2. Toggle IV index update;
10# 3. Send a new message from even addresses. This should update IVI index of RPL for these nodes.
11#   The RPL entry odd address should stay unchanged;
12# 4. Complete IVI Update;
13# 5. Repeate steps 2 - 4 to remove RPL entry with odd address from RPL and cause fragmentation;
14overlay=overlay_pst_conf
15RunTest mesh_replay_fragmentation \
16    rpc_rx_rpl_frag -flash=../results/mesh_replay_fragmentation/flash.bin -flash_erase \
17    rpc_tx_rpl_frag
18
19# Simulate reboot and test that RPL entries are restored correctly after defragmentation
20overlay=overlay_pst_conf
21RunTest mesh_replay_fragmentation \
22    rpc_rx_reboot_after_defrag -flash=../results/mesh_replay_fragmentation/flash.bin -flash_rm
23
24overlay="overlay_pst_conf_overlay_psa_conf"
25RunTest mesh_replay_fragmentation_psa \
26    rpc_rx_rpl_frag -flash=../results/mesh_replay_fragmentation_psa/flash.bin -flash_erase \
27    rpc_tx_rpl_frag
28
29overlay="overlay_pst_conf_overlay_psa_conf"
30RunTest mesh_replay_fragmentation_psa \
31    rpc_rx_reboot_after_defrag -flash=../results/mesh_replay_fragmentation_psa/flash.bin -flash_rm
32