Skip to content

Commit ec6433e

Browse files
PavelVPVaescolar
authored andcommitted
tests: Bluetooth: Mesh: Set resync offset to 100ms for all mesh tests
Since this becomes de facto a default value for most of our tests, set it by default. Signed-off-by: Pavel Vasilyev <[email protected]>
1 parent 14138d4 commit ec6433e

File tree

4 files changed

+5
-31
lines changed

4 files changed

+5
-31
lines changed

tests/bluetooth/bsim/mesh/src/mesh_test.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,6 @@ void bt_mesh_test_setup(void)
262262
{
263263
static struct bt_mesh_prov prov;
264264

265-
/* Ensure those test devices will not drift more than
266-
* 100ms for each other in emulated time
267-
*/
268-
tm_set_phy_max_resync_offset(100000);
269-
270265
net_buf_simple_init(pub.msg, 0);
271266
net_buf_simple_init(vnd_pub.msg, 0);
272267

@@ -289,6 +284,11 @@ void bt_mesh_test_cfg_set(const struct bt_mesh_test_cfg *my_cfg, int wait_time)
289284
bst_ticker_set_next_tick_absolute(wait_time * USEC_PER_SEC);
290285
bst_result = In_progress;
291286
cfg = my_cfg;
287+
288+
/* Ensure those test devices will not drift more than
289+
* 100ms for each other in emulated time
290+
*/
291+
tm_set_phy_max_resync_offset(100000);
292292
}
293293

294294
static struct bt_mesh_test_msg *blocking_recv(k_timeout_t timeout)

tests/bluetooth/bsim/mesh/src/test_blob.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -879,8 +879,6 @@ static void test_cli_trans_complete(void)
879879
{
880880
int err;
881881

882-
tm_set_phy_max_resync_offset(100000);
883-
884882
bt_mesh_test_cfg_set(NULL, 400);
885883
bt_mesh_device_setup(&prov, &cli_comp);
886884
blob_cli_prov_and_conf(BLOB_CLI_ADDR);
@@ -923,8 +921,6 @@ static void test_cli_trans_complete(void)
923921

924922
static void test_srv_trans_complete(void)
925923
{
926-
tm_set_phy_max_resync_offset(100000);
927-
928924
bt_mesh_test_cfg_set(NULL, 400);
929925
bt_mesh_device_setup(&prov, &srv_comp);
930926
blob_srv_prov_and_conf(bt_mesh_test_own_addr_get(BLOB_CLI_ADDR));
@@ -961,7 +957,6 @@ static void test_cli_trans_resume(void)
961957
};
962958

963959
bt_mesh_test_sync_init(&sync);
964-
tm_set_phy_max_resync_offset(100000);
965960

966961
bt_mesh_test_cfg_set(NULL, 800);
967962
bt_mesh_device_setup(&prov, &cli_comp);
@@ -1033,7 +1028,6 @@ static void test_srv_trans_resume(void)
10331028
};
10341029

10351030
bt_mesh_test_sync_init(&sync);
1036-
tm_set_phy_max_resync_offset(100000);
10371031

10381032
bt_mesh_test_cfg_set(NULL, 800);
10391033
bt_mesh_device_setup(&prov, &srv_comp);
@@ -1090,8 +1084,6 @@ static void test_cli_trans_persistency_pull(void)
10901084
{
10911085
int err;
10921086

1093-
tm_set_phy_max_resync_offset(100000);
1094-
10951087
bt_mesh_test_cfg_set(NULL, 240);
10961088
bt_mesh_device_setup(&prov, &cli_comp);
10971089
blob_cli_prov_and_conf(BLOB_CLI_ADDR);
@@ -1129,8 +1121,6 @@ static void test_cli_trans_persistency_pull(void)
11291121

11301122
static void test_srv_trans_persistency_pull(void)
11311123
{
1132-
tm_set_phy_max_resync_offset(100000);
1133-
11341124
bt_mesh_test_cfg_set(NULL, 240);
11351125
bt_mesh_device_setup(&prov, &srv_comp);
11361126
blob_srv_prov_and_conf(bt_mesh_test_own_addr_get(BLOB_CLI_ADDR));
@@ -1197,7 +1187,6 @@ static int fail_on_block_start(const struct bt_mesh_blob_io *io,
11971187

11981188
static void cli_common_fail_on_init(void)
11991189
{
1200-
tm_set_phy_max_resync_offset(100000);
12011190
bt_mesh_test_cfg_set(NULL, 800);
12021191
bt_mesh_device_setup(&prov, &cli_comp);
12031192
blob_cli_prov_and_conf(BLOB_CLI_ADDR);
@@ -1259,8 +1248,6 @@ static void test_cli_fail_on_persistency(void)
12591248

12601249
static void common_fail_on_srv_init(const struct bt_mesh_comp *comp)
12611250
{
1262-
tm_set_phy_max_resync_offset(100000);
1263-
12641251
bt_mesh_test_cfg_set(NULL, 800);
12651252
bt_mesh_device_setup(&prov, comp);
12661253
blob_srv_prov_and_conf(bt_mesh_test_own_addr_get(BLOB_CLI_ADDR));

tests/bluetooth/bsim/mesh/src/test_dfu.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,6 @@ static void cli_common_fail_on_init(void)
658658
{
659659
const struct bt_mesh_dfu_slot *slot;
660660

661-
tm_set_phy_max_resync_offset(100000);
662661
settings_test_backend_clear();
663662
bt_mesh_test_cfg_set(NULL, 300);
664663
bt_mesh_device_setup(&prov, &cli_comp);
@@ -973,8 +972,6 @@ static void test_target_fail_on_nothing(void)
973972

974973
static void test_pre_init(void)
975974
{
976-
tm_set_phy_max_resync_offset(100000);
977-
978975
k_sem_init(&dfu_dist_ended, 0, 1);
979976
k_sem_init(&dfu_ended, 0, 1);
980977
k_sem_init(&caps_get_sem, 0, 1);

tests/bluetooth/bsim/mesh/src/test_provision.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,6 @@ static bool is_oob_auth;
142142

143143
static void test_device_init(void)
144144
{
145-
/* Ensure those test devices will not drift more than
146-
* 100ms for each other in emulated time
147-
*/
148-
tm_set_phy_max_resync_offset(100000);
149-
150145
/* Ensure that the UUID is unique: */
151146
dev_uuid[6] = '0' + get_device_nbr();
152147

@@ -156,11 +151,6 @@ static void test_device_init(void)
156151

157152
static void test_provisioner_init(void)
158153
{
159-
/* Ensure those test devices will not drift more than
160-
* 100ms for each other in emulated time
161-
*/
162-
tm_set_phy_max_resync_offset(100000);
163-
164154
atomic_set_bit(test_flags, IS_PROVISIONER);
165155
bt_mesh_test_cfg_set(NULL, WAIT_TIME);
166156
k_work_init_delayable(&oob_timer, delayed_input);

0 commit comments

Comments
 (0)