From: Iulia Tanasescu <iulia.tanasescu@nxp.com>
To: linux-bluetooth@vger.kernel.org
Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com,
silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com,
andrei.istodorescu@nxp.com, luiz.dentz@gmail.com,
Iulia Tanasescu <iulia.tanasescu@nxp.com>
Subject: [PATCH BlueZ 1/1] test-bap: Add Broadcast Sink STR one BIS tests
Date: Mon, 20 May 2024 13:20:14 +0300 [thread overview]
Message-ID: <20240520102014.24236-2-iulia.tanasescu@nxp.com> (raw)
In-Reply-To: <20240520102014.24236-1-iulia.tanasescu@nxp.com>
4.14.2 Broadcast Audio Stream with One BIS - Sink (page 189):
Test Purpose:
Verify that a Broadcast Sink IUT can stream one BIS from a
Broadcast Source. Verification is performed for each set of
codec specific capabilities in turn.
Test Case Configuration:
BAP/BSNK/STR/BV-01-C [BSNK, LC3 8_1]
BAP/BSNK/STR/BV-02-C [BSNK, LC3 8_2]
BAP/BSNK/STR/BV-03-C [BSNK, LC3 16_1]
BAP/BSNK/STR/BV-04-C [BSNK, LC3 16_2]
BAP/BSNK/STR/BV-05-C [BSNK, LC3 24_1]
BAP/BSNK/STR/BV-06-C [BSNK, LC3 24_2]
BAP/BSNK/STR/BV-07-C [BSNK, LC3 32_1]
BAP/BSNK/STR/BV-08-C [BSNK, LC3 32_2]
BAP/BSNK/STR/BV-09-C [BSNK, LC3 44.1_1]
BAP/BSNK/STR/BV-10-C [BSNK, LC3 44.1_2]
BAP/BSNK/STR/BV-11-C [BSNK, LC3 48_1]
BAP/BSNK/STR/BV-12-C [BSNK, LC3 48_2]
BAP/BSNK/STR/BV-13-C [BSNK, LC3 48_3]
BAP/BSNK/STR/BV-14-C [BSNK, LC3 48_4]
BAP/BSNK/STR/BV-15-C [BSNK, LC3 48_5]
BAP/BSNK/STR/BV-16-C [BSNK, LC3 48_6]
BAP/BSNK/STR/BV-17-C [BSNK, VS]
Pass verdict:
The IUT synchronizes to the Lower Tester (the Link Layer
receives a BIS Data PDU). The host on the IUT receives an
LE BIG Sync Established event.
If the Codec ID is LC3, the IUT receives BIS Data PDUs on
the broadcast Audio Stream containing encoded LC3 audio data
formatted using the LC3 Media Packet format.
If the Codec ID is a vendor-specific Codec ID, the IUT
receives BIS Data PDUs on the broadcast Audio Stream.
The parameters included in the Codec_Specific_Configuration
data are as defined in TSPX_VS_Codec_Specific_Configuration.
If the Codec ID is LC3, each parameter included in
Codec_Specific_Configuration data is formatted in an LTV
structure with the length, type, and value specified in
Table 4.81.
Test Summary
------------
BAP/BSNK/STR/BV-01-C [BSNK, LC3 8_1] Passed
BAP/BSNK/STR/BV-02-C [BSNK, LC3 8_2] Passed
BAP/BSNK/STR/BV-03-C [BSNK, LC3 16_1] Passed
BAP/BSNK/STR/BV-04-C [BSNK, LC3 16_2] Passed
BAP/BSNK/STR/BV-05-C [BSNK, LC3 24_1] Passed
BAP/BSNK/STR/BV-06-C [BSNK, LC3 24_2] Passed
BAP/BSNK/STR/BV-07-C [BSNK, LC3 32_1] Passed
BAP/BSNK/STR/BV-08-C [BSNK, LC3 32_2] Passed
BAP/BSNK/STR/BV-09-C [BSNK, LC3 44.1_1] Passed
BAP/BSNK/STR/BV-10-C [BSNK, LC3 44.1_2] Passed
BAP/BSNK/STR/BV-11-C [BSNK, LC3 48_1] Passed
BAP/BSNK/STR/BV-12-C [BSNK, LC3 48_2] Passed
BAP/BSNK/STR/BV-13-C [BSNK, LC3 48_3] Passed
BAP/BSNK/STR/BV-14-C [BSNK, LC3 48_4] Passed
BAP/BSNK/STR/BV-15-C [BSNK, LC3 48_5] Passed
BAP/BSNK/STR/BV-16-C [BSNK, LC3 48_6] Passed
BAP/BSNK/STR/BV-17-C [BSNK, VS] Passed
---
unit/test-bap.c | 209 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 209 insertions(+)
diff --git a/unit/test-bap.c b/unit/test-bap.c
index 46ee0e4e5..20609694e 100644
--- a/unit/test-bap.c
+++ b/unit/test-bap.c
@@ -6343,6 +6343,214 @@ static void test_bsnk_scc(void)
NULL, test_bcast, &cfg_bsnk_vs, IOV_NULL);
}
+static void bsnk_state_str(struct bt_bap_stream *stream, uint8_t old_state,
+ uint8_t new_state, void *user_data)
+{
+ struct test_data *data = user_data;
+ struct iovec *cc;
+
+ switch (new_state) {
+ case BT_BAP_STREAM_STATE_CONFIG:
+ if (old_state == BT_BAP_STREAM_STATE_IDLE) {
+ /* Check that stream has been configured as expected */
+ cc = bt_bap_stream_get_config(stream);
+
+ g_assert(cc);
+ g_assert(cc->iov_len == data->cfg->cc.iov_len);
+ g_assert(memcmp(cc->iov_base, data->cfg->cc.iov_base,
+ cc->iov_len) == 0);
+
+ /* Enable stream */
+ bt_bap_stream_enable(stream, true, NULL, NULL, NULL);
+ } else if (old_state == BT_BAP_STREAM_STATE_CONFIG) {
+ /* Start stream */
+ bt_bap_stream_start(stream, NULL, NULL);
+ } else {
+ /* Other state transitions are invalid */
+ tester_test_failed();
+ }
+
+ break;
+ case BT_BAP_STREAM_STATE_STREAMING:
+ tester_test_passed();
+ break;
+ }
+}
+
+static struct test_config cfg_bsnk_str_8_1 = {
+ .cc = LC3_CONFIG_8_1,
+ .qos = QOS_BCAST,
+ .snk = true,
+ .state_func = bsnk_state_str,
+};
+
+static struct test_config cfg_bsnk_str_8_2 = {
+ .cc = LC3_CONFIG_8_2,
+ .qos = QOS_BCAST,
+ .snk = true,
+ .state_func = bsnk_state_str,
+};
+
+static struct test_config cfg_bsnk_str_16_1 = {
+ .cc = LC3_CONFIG_16_1,
+ .qos = QOS_BCAST,
+ .snk = true,
+ .state_func = bsnk_state_str,
+};
+
+static struct test_config cfg_bsnk_str_16_2 = {
+ .cc = LC3_CONFIG_16_2,
+ .qos = QOS_BCAST,
+ .snk = true,
+ .state_func = bsnk_state_str,
+};
+
+static struct test_config cfg_bsnk_str_24_1 = {
+ .cc = LC3_CONFIG_24_1,
+ .qos = QOS_BCAST,
+ .snk = true,
+ .state_func = bsnk_state_str,
+};
+
+static struct test_config cfg_bsnk_str_24_2 = {
+ .cc = LC3_CONFIG_24_2,
+ .qos = QOS_BCAST,
+ .snk = true,
+ .state_func = bsnk_state_str,
+};
+
+static struct test_config cfg_bsnk_str_32_1 = {
+ .cc = LC3_CONFIG_32_1,
+ .qos = QOS_BCAST,
+ .snk = true,
+ .state_func = bsnk_state_str,
+};
+
+static struct test_config cfg_bsnk_str_32_2 = {
+ .cc = LC3_CONFIG_32_2,
+ .qos = QOS_BCAST,
+ .snk = true,
+ .state_func = bsnk_state_str,
+};
+
+static struct test_config cfg_bsnk_str_44_1 = {
+ .cc = LC3_CONFIG_44_1,
+ .qos = QOS_BCAST,
+ .snk = true,
+ .state_func = bsnk_state_str,
+};
+
+static struct test_config cfg_bsnk_str_44_2 = {
+ .cc = LC3_CONFIG_44_2,
+ .qos = QOS_BCAST,
+ .snk = true,
+ .state_func = bsnk_state_str,
+};
+
+static struct test_config cfg_bsnk_str_48_1 = {
+ .cc = LC3_CONFIG_48_1,
+ .qos = QOS_BCAST,
+ .snk = true,
+ .state_func = bsnk_state_str,
+};
+
+static struct test_config cfg_bsnk_str_48_2 = {
+ .cc = LC3_CONFIG_48_2,
+ .qos = QOS_BCAST,
+ .snk = true,
+ .state_func = bsnk_state_str,
+};
+
+static struct test_config cfg_bsnk_str_48_3 = {
+ .cc = LC3_CONFIG_48_3,
+ .qos = QOS_BCAST,
+ .snk = true,
+ .state_func = bsnk_state_str,
+};
+
+static struct test_config cfg_bsnk_str_48_4 = {
+ .cc = LC3_CONFIG_48_4,
+ .qos = QOS_BCAST,
+ .snk = true,
+ .state_func = bsnk_state_str,
+};
+
+static struct test_config cfg_bsnk_str_48_5 = {
+ .cc = LC3_CONFIG_48_5,
+ .qos = QOS_BCAST,
+ .snk = true,
+ .state_func = bsnk_state_str,
+};
+
+static struct test_config cfg_bsnk_str_48_6 = {
+ .cc = LC3_CONFIG_48_6,
+ .qos = QOS_BCAST,
+ .snk = true,
+ .state_func = bsnk_state_str,
+};
+
+static struct test_config cfg_bsnk_str_vs = {
+ .cc = UTIL_IOV_INIT(VS_CC),
+ .qos = QOS_BCAST,
+ .snk = true,
+ .vs = true,
+ .state_func = bsnk_state_str,
+};
+
+static void test_bsnk_str(void)
+{
+ define_test("BAP/BSNK/STR/BV-01-C [BSNK, LC3 8_1]",
+ NULL, test_bcast, &cfg_bsnk_str_8_1, IOV_NULL);
+
+ define_test("BAP/BSNK/STR/BV-02-C [BSNK, LC3 8_2]",
+ NULL, test_bcast, &cfg_bsnk_str_8_2, IOV_NULL);
+
+ define_test("BAP/BSNK/STR/BV-03-C [BSNK, LC3 16_1]",
+ NULL, test_bcast, &cfg_bsnk_str_16_1, IOV_NULL);
+
+ define_test("BAP/BSNK/STR/BV-04-C [BSNK, LC3 16_2]",
+ NULL, test_bcast, &cfg_bsnk_str_16_2, IOV_NULL);
+
+ define_test("BAP/BSNK/STR/BV-05-C [BSNK, LC3 24_1]",
+ NULL, test_bcast, &cfg_bsnk_str_24_1, IOV_NULL);
+
+ define_test("BAP/BSNK/STR/BV-06-C [BSNK, LC3 24_2]",
+ NULL, test_bcast, &cfg_bsnk_str_24_2, IOV_NULL);
+
+ define_test("BAP/BSNK/STR/BV-07-C [BSNK, LC3 32_1]",
+ NULL, test_bcast, &cfg_bsnk_str_32_1, IOV_NULL);
+
+ define_test("BAP/BSNK/STR/BV-08-C [BSNK, LC3 32_2]",
+ NULL, test_bcast, &cfg_bsnk_str_32_2, IOV_NULL);
+
+ define_test("BAP/BSNK/STR/BV-09-C [BSNK, LC3 44.1_1]",
+ NULL, test_bcast, &cfg_bsnk_str_44_1, IOV_NULL);
+
+ define_test("BAP/BSNK/STR/BV-10-C [BSNK, LC3 44.1_2]",
+ NULL, test_bcast, &cfg_bsnk_str_44_2, IOV_NULL);
+
+ define_test("BAP/BSNK/STR/BV-11-C [BSNK, LC3 48_1]",
+ NULL, test_bcast, &cfg_bsnk_str_48_1, IOV_NULL);
+
+ define_test("BAP/BSNK/STR/BV-12-C [BSNK, LC3 48_2]",
+ NULL, test_bcast, &cfg_bsnk_str_48_2, IOV_NULL);
+
+ define_test("BAP/BSNK/STR/BV-13-C [BSNK, LC3 48_3]",
+ NULL, test_bcast, &cfg_bsnk_str_48_3, IOV_NULL);
+
+ define_test("BAP/BSNK/STR/BV-14-C [BSNK, LC3 48_4]",
+ NULL, test_bcast, &cfg_bsnk_str_48_4, IOV_NULL);
+
+ define_test("BAP/BSNK/STR/BV-15-C [BSNK, LC3 48_5]",
+ NULL, test_bcast, &cfg_bsnk_str_48_5, IOV_NULL);
+
+ define_test("BAP/BSNK/STR/BV-16-C [BSNK, LC3 48_6]",
+ NULL, test_bcast, &cfg_bsnk_str_48_6, IOV_NULL);
+
+ define_test("BAP/BSNK/STR/BV-17-C [BSNK, VS]",
+ NULL, test_bcast, &cfg_bsnk_str_vs, IOV_NULL);
+}
+
int main(int argc, char *argv[])
{
tester_init(&argc, &argv);
@@ -6351,6 +6559,7 @@ int main(int argc, char *argv[])
test_scc();
test_bsrc_scc();
test_bsnk_scc();
+ test_bsnk_str();
return tester_run();
}
--
2.39.2
next prev parent reply other threads:[~2024-05-20 10:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-20 10:20 [PATCH BlueZ 0/1] test-bap: Add Broadcast Sink STR one BIS tests Iulia Tanasescu
2024-05-20 10:20 ` Iulia Tanasescu [this message]
2024-05-20 12:07 ` bluez.test.bot
2024-05-20 20:00 ` [PATCH BlueZ 0/1] " patchwork-bot+bluetooth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240520102014.24236-2-iulia.tanasescu@nxp.com \
--to=iulia.tanasescu@nxp.com \
--cc=andrei.istodorescu@nxp.com \
--cc=claudia.rosu@nxp.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=mihai-octavian.urzica@nxp.com \
--cc=silviu.barbulescu@nxp.com \
--cc=vlad.pruteanu@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox