Skip to content

Commit 448480d

Browse files
alexsvenkoffes
authored andcommitted
tests: nrf_auraconfig: Create test vectors
- Create test vectors for all usecases - Debugging: UC2 doesn't work if both BIGs are started - OCT-3203 Signed-off-by: Alexander Svensen <[email protected]>
1 parent b1a108d commit 448480d

File tree

17 files changed

+785
-97
lines changed

17 files changed

+785
-97
lines changed

samples/bluetooth/nrf_auraconfig/prj.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ CONFIG_SOC_NRF53_CPUNET_ENABLE=y
3636
CONFIG_ZBUS=y
3737
CONFIG_ZBUS_RUNTIME_OBSERVERS=y
3838
CONFIG_ZBUS_MSG_SUBSCRIBER=y
39+
CONFIG_ZBUS_MSG_SUBSCRIBER_NET_BUF_POOL_SIZE=20
3940

4041
CONFIG_REGULATOR=y
4142
CONFIG_CONTIN_ARRAY=y

samples/bluetooth/nrf_auraconfig/src/nrf_auraconfig.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,14 +1291,14 @@ static int cmd_packing(const struct shell *shell, size_t argc, char **argv)
12911291
return 0;
12921292
}
12931293

1294-
static int cmd_lang_set(const struct shell *shell, size_t argc, char **argv)
1294+
static int cmd_lang(const struct shell *shell, size_t argc, char **argv)
12951295
{
12961296
int ret;
12971297
uint8_t big_index;
12981298
uint8_t sub_index;
12991299

13001300
if (argc < 4) {
1301-
shell_error(shell, "Usage: nac lang_set <language> <BIG index> <subgroup index>");
1301+
shell_error(shell, "Usage: nac lang <language> <BIG index> <subgroup index>");
13021302
return -EINVAL;
13031303
}
13041304

@@ -2164,7 +2164,7 @@ static void lecture_set(const struct shell *shell)
21642164
char *broadcast_id_argv[3] = {"fixed", "0", "0x123456"};
21652165
char *packing_argv[3] = {"packing", "int", "0"};
21662166

2167-
char *lang_argv[4] = {"lang_set", "eng", "0", "0"};
2167+
char *lang_argv[4] = {"lang", "eng", "0", "0"};
21682168

21692169
char *context_argv[4] = {"context", "live", "0", "0"};
21702170

@@ -2184,7 +2184,7 @@ static void lecture_set(const struct shell *shell)
21842184
cmd_fixed_id(shell, 3, broadcast_id_argv);
21852185
cmd_packing(shell, 3, packing_argv);
21862186

2187-
cmd_lang_set(shell, 4, lang_argv);
2187+
cmd_lang(shell, 4, lang_argv);
21882188

21892189
cmd_context(shell, 4, context_argv);
21902190

@@ -2356,9 +2356,9 @@ static void multi_language_set(const struct shell *shell)
23562356
char *name_argv[3] = {"broadcast_name", "Multi-language", "0"};
23572357
char *packing_argv[3] = {"packing", "int", "0"};
23582358

2359-
char *lang0_argv[4] = {"lang_set", "eng", "0", "0"};
2360-
char *lang1_argv[4] = {"lang_set", "chi", "0", "1"};
2361-
char *lang2_argv[4] = {"lang_set", "nor", "0", "2"};
2359+
char *lang0_argv[4] = {"lang", "eng", "0", "0"};
2360+
char *lang1_argv[4] = {"lang", "chi", "0", "1"};
2361+
char *lang2_argv[4] = {"lang", "nor", "0", "2"};
23622362

23632363
char *context0_argv[4] = {"context", "unspecified", "0", "0"};
23642364
char *context1_argv[4] = {"context", "unspecified", "0", "1"};
@@ -2389,9 +2389,9 @@ static void multi_language_set(const struct shell *shell)
23892389
cmd_broadcast_name(shell, 3, name_argv);
23902390
cmd_packing(shell, 3, packing_argv);
23912391

2392-
cmd_lang_set(shell, 4, lang0_argv);
2393-
cmd_lang_set(shell, 4, lang1_argv);
2394-
cmd_lang_set(shell, 4, lang2_argv);
2392+
cmd_lang(shell, 4, lang0_argv);
2393+
cmd_lang(shell, 4, lang1_argv);
2394+
cmd_lang(shell, 4, lang2_argv);
23952395

23962396
cmd_context(shell, 4, context0_argv);
23972397
cmd_context(shell, 4, context1_argv);
@@ -2464,8 +2464,8 @@ static void personal_multi_language_set(const struct shell *shell)
24642464
char *packing_argv[3] = {"packing", "int", "0"};
24652465
char *encrypt_argv[4] = {"encrypt", "1", "0", "Auratest"};
24662466

2467-
char *lang0_argv[4] = {"lang_set", "eng", "0", "0"};
2468-
char *lang1_argv[4] = {"lang_set", "chi", "0", "1"};
2467+
char *lang0_argv[4] = {"lang", "eng", "0", "0"};
2468+
char *lang1_argv[4] = {"lang", "chi", "0", "1"};
24692469

24702470
char *context0_argv[4] = {"context", "media", "0", "0"};
24712471
char *context1_argv[4] = {"context", "media", "0", "1"};
@@ -2504,8 +2504,8 @@ static void personal_multi_language_set(const struct shell *shell)
25042504
cmd_packing(shell, 3, packing_argv);
25052505
cmd_encrypt(shell, 4, encrypt_argv);
25062506

2507-
cmd_lang_set(shell, 4, lang0_argv);
2508-
cmd_lang_set(shell, 4, lang1_argv);
2507+
cmd_lang(shell, 4, lang0_argv);
2508+
cmd_lang(shell, 4, lang1_argv);
25092509

25102510
cmd_context(shell, 4, context0_argv);
25112511
cmd_context(shell, 4, context1_argv);
@@ -2640,7 +2640,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(
26402640
SHELL_COND_CMD(CONFIG_SHELL, show, NULL, "Show current configuration", cmd_show),
26412641
SHELL_COND_CMD(CONFIG_SHELL, packing, NULL, "Set type of packing", cmd_packing),
26422642
SHELL_COND_CMD(CONFIG_SHELL, preset, NULL, "Set preset", cmd_preset),
2643-
SHELL_COND_CMD(CONFIG_SHELL, lang, NULL, "Set language", cmd_lang_set),
2643+
SHELL_COND_CMD(CONFIG_SHELL, lang, NULL, "Set language", cmd_lang),
26442644
SHELL_COND_CMD(CONFIG_SHELL, immediate, NULL, "Set immediate rendering flag",
26452645
cmd_immediate_set),
26462646
SHELL_COND_CMD(CONFIG_SHELL, num_subgroups, NULL, "Set number of subgroups",

tests/bluetooth/bsim/nrf_auraconfig/_nrf_auraconfig_simulation.sh

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -50,35 +50,16 @@ while [[ $# -gt 0 ]]; do
5050
esac
5151
done
5252

53-
# Print out the parsed arguments for 'nac' and 'nac_test'
54-
if [ ${#nac_args[@]} -gt 0 ]; then
55-
echo "Arguments for 'nac':"
56-
for arg in "${nac_args[@]}"; do
57-
echo "- $arg"
58-
done
59-
else
60-
echo "No arguments found for 'nac'."
61-
fi
62-
63-
if [ ${#nac_test_args[@]} -gt 0 ]; then
64-
echo "Arguments for 'nac_test':"
65-
for arg in "${nac_test_args[@]}"; do
66-
echo "- $arg"
67-
done
68-
else
69-
echo "No arguments found for 'nac_test'."
70-
fi
71-
72-
7353
source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
7454
cd ${BSIM_OUT_PATH}/bin
7555

7656
Execute ./bs_nrf5340bsim_nrf5340_cpuapp____nrf_tests_bluetooth_bsim_nrf_auraconfig_prj_conf \
77-
-v=${VERBOSITY} -s=${SIM_ID} -d=0 -cpu0_testid=nac -argstest ${nac_args[@]}
57+
-v=${VERBOSITY} -s=${SIM_ID} -d=0 -RealEncryption=1 -cpu0_testid=nac -argstest ${nac_args[@]}
7858

7959
Execute ./bs_nrf5340bsim_nrf5340_cpuapp____nrf_tests_bluetooth_bsim_nrf_auraconfig_tester_prj_conf \
80-
-v=${VERBOSITY} -s=${SIM_ID} -d=1 -cpu0_testid=nac_test -argstest ${nac_test_args[@]}
60+
-v=${VERBOSITY} -s=${SIM_ID} -d=1 -RealEncryption=1 -cpu0_testid=nac_test \
61+
-argstest ${nac_test_args[@]}
8162

82-
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY} -s=${SIM_ID} -D=2 -sim_length=10e6
63+
Execute ./bs_2G4_phy_v1 -v=${VERBOSITY} -s=${SIM_ID} -D=2 -sim_length=2e6
8364

8465
wait_for_background_jobs # Wait for all programs in background and return != 0 if any fails

tests/bluetooth/bsim/nrf_auraconfig/compile.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
# Copyright 2024 Nordic Semiconductor ASA
33
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
44

5-
# Compile all the applications needed by the bsim tests in these subfolders
6-
#INCR_BUILD=1
7-
85
BOARD=nrf5340bsim/nrf5340/cpuapp
96
set -ue
107

tests/bluetooth/bsim/nrf_auraconfig/prj.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ CONFIG_SOC_NRF53_CPUNET_ENABLE=y
3838
CONFIG_ZBUS=y
3939
CONFIG_ZBUS_RUNTIME_OBSERVERS=y
4040
CONFIG_ZBUS_MSG_SUBSCRIBER=y
41+
CONFIG_ZBUS_MSG_SUBSCRIBER_NET_BUF_POOL_SIZE=20
4142

4243
CONFIG_REGULATOR=y
4344
CONFIG_CONTIN_ARRAY=y

tests/bluetooth/bsim/nrf_auraconfig/src/main.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ LOG_MODULE_REGISTER(nac_test, CONFIG_NAC_TEST_LOG_LEVEL);
1717

1818
extern enum bst_result_t bst_result;
1919

20-
#define MAX_ARGS 50
21-
#define MAX_ARG_LEN 20
20+
#define MAX_ARGS 200
21+
#define MAX_ARG_LEN 50
2222
#define ARG_COMMAND "nac"
2323
#define MAX_COMMAND_LEN 60
2424

@@ -32,10 +32,10 @@ static void test_args(int argc, char *argv[])
3232

3333
for (int i = 0; i < argc; i++) {
3434
if (i > MAX_ARGS) {
35-
TEST_FAIL("ENOMEM");
35+
TEST_FAIL("ENOMEM, MAX_ARG");
3636
}
3737
if (strlen(argv[i]) > MAX_ARG_LEN) {
38-
TEST_FAIL("ENOMEM");
38+
TEST_FAIL("ENOMEM, MAX_ARG_LEN");
3939
}
4040

4141
memcpy(argv_copy[i], argv[i], strlen(argv[i]) + 1);
@@ -58,7 +58,6 @@ static int modules_configure(void)
5858
}
5959

6060
strcat(cmd_str, argv_copy[0]);
61-
strcat(cmd_str, " ");
6261

6362
/* Parse argv_copy, divide by keyword ARG_COMMAND and send commands to shell */
6463
for (int i = 1; i < argc_copy; i++) {
@@ -72,15 +71,14 @@ static int modules_configure(void)
7271
memset(cmd_str, '\0', sizeof(cmd_str));
7372

7473
strcat(cmd_str, argv_copy[i]);
75-
strcat(cmd_str, " ");
7674
} else {
7775
if (strlen(cmd_str) + strlen(argv_copy[i]) > MAX_COMMAND_LEN) {
7876
LOG_ERR("Command too long");
7977
return -EINVAL;
8078
}
8179

82-
strcat(cmd_str, argv_copy[i]);
8380
strcat(cmd_str, " ");
81+
strcat(cmd_str, argv_copy[i]);
8482
}
8583
}
8684

tests/bluetooth/bsim/nrf_auraconfig/tester/src/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ LOG_MODULE_REGISTER(nac_tester, CONFIG_NAC_TESTER_LOG_LEVEL);
1717

1818
extern enum bst_result_t bst_result;
1919

20-
#define MAX_ARGS 50
21-
#define MAX_ARG_LEN 20
20+
#define MAX_ARGS 200
21+
#define MAX_ARG_LEN 50
2222
#define ARG_COMMAND "nac_test"
2323
#define MAX_COMMAND_LEN 60
2424

@@ -32,10 +32,10 @@ static void test_args(int argc, char *argv[])
3232

3333
for (int i = 0; i < argc; i++) {
3434
if (i > MAX_ARGS) {
35-
TEST_FAIL("ENOMEM");
35+
TEST_FAIL("ENOMEM, MAX_ARG");
3636
}
3737
if (strlen(argv[i]) > MAX_ARG_LEN) {
38-
TEST_FAIL("ENOMEM");
38+
TEST_FAIL("ENOMEM, MAX_ARG_LEN");
3939
}
4040
memcpy(argv_copy[i], argv[i], strlen(argv[i]) + 1);
4141
}

0 commit comments

Comments
 (0)