diff --git a/tests/bsim/bluetooth/mesh/prj_mesh1d1.conf b/tests/bsim/bluetooth/mesh/prj_mesh1d1.conf index 8a8b78fe8ea..69c1055999f 100644 --- a/tests/bsim/bluetooth/mesh/prj_mesh1d1.conf +++ b/tests/bsim/bluetooth/mesh/prj_mesh1d1.conf @@ -61,6 +61,8 @@ CONFIG_BT_MESH_DFD_SRV=y CONFIG_BT_MESH_DFU_SLOT_CNT=3 CONFIG_BT_MESH_PRIV_BEACON_SRV=y CONFIG_BT_MESH_PRIV_BEACON_CLI=y +CONFIG_BT_MESH_OD_PRIV_PROXY_SRV=y +CONFIG_BT_MESH_OD_PRIV_PROXY_CLI=y CONFIG_BT_MESH_COMP_PAGE_1=y CONFIG_BT_MESH_COMP_PAGE_2=y diff --git a/tests/bsim/bluetooth/mesh/src/mesh_test.c b/tests/bsim/bluetooth/mesh/src/mesh_test.c index 13eedd9e2de..538af49109e 100644 --- a/tests/bsim/bluetooth/mesh/src/mesh_test.c +++ b/tests/bsim/bluetooth/mesh/src/mesh_test.c @@ -170,6 +170,9 @@ static struct bt_mesh_sar_cfg_cli sar_cfg_cli; static struct bt_mesh_priv_beacon_cli priv_beacon_cli; #endif +#if defined(CONFIG_BT_MESH_OD_PRIV_PROXY_CLI) +static struct bt_mesh_od_priv_proxy_cli priv_proxy_cli; +#endif static struct bt_mesh_model models[] = { BT_MESH_MODEL_CFG_SRV, @@ -184,6 +187,12 @@ static struct bt_mesh_model models[] = { BT_MESH_MODEL_PRIV_BEACON_SRV, BT_MESH_MODEL_PRIV_BEACON_CLI(&priv_beacon_cli), #endif +#if defined(CONFIG_BT_MESH_OD_PRIV_PROXY_SRV) + BT_MESH_MODEL_OD_PRIV_PROXY_SRV, +#endif +#if defined(CONFIG_BT_MESH_OD_PRIV_PROXY_CLI) + BT_MESH_MODEL_OD_PRIV_PROXY_CLI(&priv_proxy_cli), +#endif }; struct bt_mesh_model *test_model = &models[2]; diff --git a/tests/bsim/bluetooth/mesh/src/test_persistence.c b/tests/bsim/bluetooth/mesh/src/test_persistence.c index 0269b42fb5d..24d992e48e8 100644 --- a/tests/bsim/bluetooth/mesh/src/test_persistence.c +++ b/tests/bsim/bluetooth/mesh/src/test_persistence.c @@ -209,6 +209,9 @@ static const struct stack_cfg { uint8_t priv_beacon_int; uint8_t priv_beacon_gatt; #endif +#ifdef CONFIG_BT_MESH_OD_PRIV_PROXY_SRV + uint8_t priv_proxy_val; +#endif } stack_cfgs[] = { { .beacon = 1, @@ -221,6 +224,9 @@ static const struct stack_cfg { .priv_beacon = 1, .priv_beacon_int = 123, .priv_beacon_gatt = 0, +#endif +#ifdef CONFIG_BT_MESH_OD_PRIV_PROXY_SRV + .priv_proxy_val = 10, #endif }, { @@ -234,6 +240,9 @@ static const struct stack_cfg { .priv_beacon = 1, .priv_beacon_int = 100, .priv_beacon_gatt = 1, +#endif +#ifdef CONFIG_BT_MESH_OD_PRIV_PROXY_SRV + .priv_proxy_val = 20, #endif }, }; @@ -946,6 +955,16 @@ static void test_cfg_save(void) } #endif +#if defined(CONFIG_BT_MESH_OD_PRIV_PROXY_SRV) && defined(CONFIG_BT_MESH_OD_PRIV_PROXY_CLI) + uint8_t priv_proxy_val; + + err = bt_mesh_od_priv_proxy_cli_set(test_netkey_idx, TEST_ADDR, + current_stack_cfg->priv_proxy_val, &priv_proxy_val); + if (err || priv_proxy_val != current_stack_cfg->priv_proxy_val) { + FAIL("Failed to set OD Private proxy (err %d, value %d)", err, priv_proxy_val); + } +#endif + k_sleep(K_SECONDS(CONFIG_BT_MESH_STORE_TIMEOUT)); PASS(); @@ -1015,6 +1034,15 @@ static void test_cfg_load(void) } #endif +#if defined(CONFIG_BT_MESH_OD_PRIV_PROXY_SRV) && defined(CONFIG_BT_MESH_OD_PRIV_PROXY_CLI) + uint8_t priv_proxy_val; + + err = bt_mesh_od_priv_proxy_cli_get(test_netkey_idx, TEST_ADDR, &priv_proxy_val); + if (err || priv_proxy_val != current_stack_cfg->priv_proxy_val) { + FAIL("Private proxy get failed (err %d, value %u)", err, priv_proxy_val); + } +#endif + PASS(); }