Skip to content

Commit 7ffefcc

Browse files
PavelVPVcfriedt
authored andcommitted
tests: Bluetooth: Mesh: Test node reprovisioning with persistent storage
This commit adds a test checking that a node removes all data from persistent storage after being unprovisioned. Signed-off-by: Pavel Vasilyev <[email protected]>
1 parent 79af744 commit 7ffefcc

File tree

4 files changed

+243
-49
lines changed

4 files changed

+243
-49
lines changed

tests/bluetooth/bsim_bt/bsim_test_mesh/src/mesh_test.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,14 @@ int __weak test_model_settings_set(struct bt_mesh_model *model,
103103
return -1;
104104
}
105105

106+
void __weak test_model_reset(struct bt_mesh_model *model)
107+
{
108+
/* No-op. */
109+
}
110+
106111
static const struct bt_mesh_model_cb test_model_cb = {
107112
.settings_set = test_model_settings_set,
113+
.reset = test_model_reset,
108114
};
109115

110116
static struct bt_mesh_model_pub pub = {
@@ -128,8 +134,14 @@ int __weak test_vnd_model_settings_set(struct bt_mesh_model *model,
128134
return -1;
129135
}
130136

137+
void __weak test_vnd_model_reset(struct bt_mesh_model *model)
138+
{
139+
/* No-op. */
140+
}
141+
131142
static const struct bt_mesh_model_cb test_vnd_model_cb = {
132143
.settings_set = test_vnd_model_settings_set,
144+
.reset = test_vnd_model_reset,
133145
};
134146

135147
static struct bt_mesh_model_pub vnd_pub = {

tests/bluetooth/bsim_bt/bsim_test_mesh/src/mesh_test.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@
6363
} \
6464
} while (0)
6565

66+
#define ASSERT_FALSE(cond, ...) \
67+
do { \
68+
if (cond) { \
69+
bst_result = Failed; \
70+
bs_trace_error_time_line( \
71+
#cond " is true.", ##__VA_ARGS__); \
72+
} \
73+
} while (0)
74+
6675
#define ASSERT_EQUAL(expected, got) \
6776
do { \
6877
if ((expected) != (got)) { \

0 commit comments

Comments
 (0)