From patchwork Mon May 27 07:54:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 799606 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2056.outbound.protection.outlook.com [40.107.6.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2268F2E636 for ; Mon, 27 May 2024 07:54:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716796495; cv=fail; b=TaJkQUFCxHqpE6RzDxJxkMPaMekbT3rQ8nZ3QIisB84+GzaJEH/m++IaiWFAQXriTFmj3UOC8p2OsWHpjQG+ZtIGl0oivNoNREt48fNn8fikA84J1pY27tvjxFJmECkUSu0CSlrYItliU4NgPp3AeXm+HRSEeqHlGZez3hSb0dw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716796495; c=relaxed/simple; bh=uF3dVtg2xbratddzgTVurKfcLNrlWqZm2sipYdVHitg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Ct7aua3Her5d4MBsTOJLvlFqhlX+XcWf6hW5a6W3JP4i/fxzOvt596pVmHi7uEyYkFqMwWpPZMwDA+Fdln1AEV0wpy8L39bFNsd9HgVH+jPjenEDj/lbiZxTU5URVCJOqkeciRvHnEdMKYQo/of/VAcNp7jdoYk+i9Kc1JZv/Hg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=P/J844Vc; arc=fail smtp.client-ip=40.107.6.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="P/J844Vc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CrtRx7iF6Ro0M0PYestoHESvq5n/1NLxMpTB7aDsiHu1lUg6Y8JjBpx7NRyYqHJpE5vZXPys9Sc/H+G7v9540l9Ywza7kpyZu7FllWRYcwL1/FZrLTLjivxT0qZmjA8MbsazzeyyCnHPUg6XdBRUPQYa3XnBaKevO0pGuBQKlo4NhbMPzATTBpufWj268tXzf+NyYjSzPA5l0hjkIiU/ESGR0SsGROsp8bwXxxdP1Zfl0D40vu/rLWgm41Eb6eR2QOHCcGfqr77QYd9/RwrfShkZAj5GujAQKbmOwZN+EhGyYmyqgzYAtWnId3i4zESKYcdRB5oLzFdn0muKA6Us5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZtFtycgseYDZtaGFkkzlb0ASvHE9l9o2b/SlFw8qKqQ=; b=LXL5EGmuRESzdynQ+VcjsMnAsJLn1glsoLMZPfrWryiEJLFviFYT0Wcf5ZNBxZlX6nJJf6gLJYrSgl5iSrtxl+b99niQfuGsKxTHcS+e5iVYEqjWCxVw16SArTIeV0eO5yY7P0RigrylIQpEcHfYn4C3qznx2lSO6fUGB1lcDGxLQ7/RaKmaJ5LymB523wa5zpz56M0VrUCfbrWp/g7/0odWzYHTa6BUuA0rvxnHG0PRE0Lus92zmozCLBOKJO9rEVwAHqPyeeI7PNMWk/WBouyJkm6/M1lb7VC5WU+Ybjlb0yWydqPI+BGcuw2cI7xVC74r2V7hi4bJm764KHOiDg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZtFtycgseYDZtaGFkkzlb0ASvHE9l9o2b/SlFw8qKqQ=; b=P/J844Vceq2EQPX6VcbNkZtNTHjBFWF2HgGCw2nFjvKHNjqojl2tfbCHRmsvGAMUbUMopw3RrNxM3SOQpOEtrx327+vW9rppEKdeECr8+0LJ217xEAx6KyD3Qa3LYlgYv10Sx11i/oisvYYnf2s++Caq2+fbcB+DgzvEcpvt+cQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) by DBBPR04MB7836.eurprd04.prod.outlook.com (2603:10a6:10:1f3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.28; Mon, 27 May 2024 07:54:51 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654%4]) with mapi id 15.20.7611.025; Mon, 27 May 2024 07:54:51 +0000 From: Iulia Tanasescu 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 Subject: [PATCH BlueZ 6/6] test-bap: Add Broadcast Source Release test Date: Mon, 27 May 2024 10:54:22 +0300 Message-Id: <20240527075422.18953-7-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240527075422.18953-1-iulia.tanasescu@nxp.com> References: <20240527075422.18953-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AM8P189CA0028.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:218::33) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|DBBPR04MB7836:EE_ X-MS-Office365-Filtering-Correlation-Id: 6c10ad66-0d0e-4db3-2cf6-08dc7e2249f7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: rqf7PdcHHCksiVX3imePr1qeiHq43zMxEdjSn6FHGdKtTFWX6mWwtTmblieYRuXFrNTN9+QNlarSa2UlKQkSjgqP1yS8SLdGY5WcRHQybcpIIKD32DdAcewmVEZtH3UvHquNtc/AuijQ1qT6qD93UGj0hGQdF17HVIQuW2/ZEdOpXk3EXX+YRiUkP97FBJZsLpADH3U2j+wrTY+4acokPu3nah/yQUwc3TA3UyxIkROhdaZT8eZZ2Oape25tJZX/NHpv32GtNpaszZnYe2TsryhrYRS1AkZG5YGQPbZ6oIcvo7e3jFuWplR8WVbbJ6vR3uJKH+58ZBUs0dgglocTmAiZI1M6mW9lW2vM4rpBm+MAdr3CGrHzYRZ8XrCgYw8AWLUQUcMk9mu/vbKPT/H3sF+IGT/3bEeA/HEVXlCKn1XfvFxWkcbeEfNQNZBJhIf2SUNnImaVPI2Bmd92upIBuwmeyqA1JCalfeQVSLi6P9WO5fOki9l+GuM6pKpCqAyruktyih0yPF1W/aUa3nDXG+H3Iqexr2V+6Pdn45MI8KZDwnvs1Q7cJOnlok6Y6F+/+zfkF7sG1+IqWajSpUec1xM4yp8gIlmC9uauB+O+hfzDKtJE4jurgPUPOQstGt1G+eK+5611Ej02fzo8c1x2dIT8RascggQqqPIWJy8pLsd7ogbKxEwxSglyGXae57bY4YOb1BQ3xEIxmXMxSiGUtUrwfhSHsMaiKscazp1Vs2CbvZ1YUv+ORRizdQKeIxElHK3ZfAA7b/IO7hzphBDgIzCYlYIqDvq0UAbyFnPlrNBn+b1ttGbYDJ9m2BoPYahuGcKVH3RVjKajUJ/G0Fn4hVwnHjqL7CTRa1XIO/c2MCklqrXgJwF8XVD+fDiD/BZONAuZoYw8oABArE1ioKal+nEawjgA1YOzUxPoKCSYl99g2H1ZQt/eudx++rEkhlFm33bdeTLofBWD9UTPr39raxCCaXk0fmowoHsSQSa4fKFGUrEOhCn8UQSDgYEMcnOecqAEnrY3rG5cAeekv9M+hhZlPCfw18QM4/wjGfDJRj66VEpkmOr5sLOXjF7/dPBzxQEJUmIQSZ3J+W3EnzAgT19ktmTCve/lOLa2JEsaQlrNy6IjKlaW34grs2XZ+TOaIKEm41bDSBZAiEMO00ALsdfs0vHyR5EYj19pRMxYQ5P1C9y841KMiLvk9cKvb1KRBRj+V/YSyHY4Odnqfb0j+nwPABv3mFYAWhoJMK7wt+85q/D7wWt6264+Vtf/nayI0GYeqH4YPMoGkyYJBbdh9A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8898.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(366007)(1800799015); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JI64FgS/uyJpemh3qYQCJBp84sqEv7G6Vs5XndmDFhLTAwFTgn/9YYuxJnpkZwNSMr047KCANmz4x7FjGrXFWvvAeEOoeYr3dqoyheyBng+NMTys64kCAGApriYsfi86sSnIjvo9P+tC7+eU/GnQvyrP8W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AY+SwcSavUKEz+uktDjPZ3HhYW9s7kimSmHLDpmdMdi4IYN972gDkvRKP3DcaVXEceiaaivUSktoRiKKbZ1t+yfJoQcvJVOvb/Is33h2ItVHrhWw3chYz2pY5vES3TPMw7NpOpWJW7zjDQmHLuqq4s6ySxb+yJ34AcYMzfy/zd3uGvfabZdzfO/WgRMr3CyLogX+iNJpKtJIQHPu4tpNoPBWQbbAyRKjwh2mbFIdV+kKJwfCT2iPNwLtSUWqfE0q3x7FvBnX4nth0awjH4l/hwVgsPRWMmiytYriKPBE6GOyWgh7bpcJM8ysQTXHpyI6joi/aKr0WeJ9U8g2wGsSfYsCoKXG4gOcBasR6AnADXywkSvj5lkJS4ieMU8ZAcWsHyQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6c10ad66-0d0e-4db3-2cf6-08dc7e2249f7 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2024 07:54:51.6052 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: slzUbHCqPorOuqwwPGA6m65nJF1+PZgcVvcNPFPTThaF4ZlJmLNcdc3xEX3Q3M2pzVoamYByD6VH4E+twzb0gQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7836 BAP/BSRC/SCC/BV-37-C [Releases Broadcast] (page 176): Test Purpose: Verify that a Broadcast Source IUT can release a broadcast Audio Stream and transition from Configured state to Idle state. Pass verdict: The IUT stops transmitting periodic advertising. Test Summary ------------ BAP/BSRC/SCC/BV-37-C [Releases Broadcast] Passed --- unit/test-bap.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/unit/test-bap.c b/unit/test-bap.c index 3fc3b5f02..47a19b8c3 100644 --- a/unit/test-bap.c +++ b/unit/test-bap.c @@ -6211,11 +6211,58 @@ static void test_bsrc_scc_disable(void) NULL, test_bcast, &cfg_bsrc_8_1_1_disable, IOV_NULL); } +static void bsrc_state_release(struct bt_bap_stream *stream, uint8_t old_state, + uint8_t new_state, void *user_data) +{ + switch (new_state) { + case BT_BAP_STREAM_STATE_CONFIG: + if (old_state == BT_BAP_STREAM_STATE_IDLE) + bt_bap_stream_enable(stream, true, NULL, NULL, NULL); + else if (old_state == BT_BAP_STREAM_STATE_STREAMING) + bt_bap_stream_release(stream, NULL, NULL); + else + /* Other transitions to CONFIG state are invalid. */ + tester_test_failed(); + break; + case BT_BAP_STREAM_STATE_ENABLING: + bt_bap_stream_start(stream, NULL, NULL); + break; + case BT_BAP_STREAM_STATE_STREAMING: + bt_bap_stream_disable(stream, true, NULL, NULL); + break; + case BT_BAP_STREAM_STATE_IDLE: + tester_test_passed(); + break; + } +} + +static struct test_config cfg_bsrc_8_1_1_release = { + .cc = LC3_CONFIG_8_1, + .qos = LC3_QOS_8_1_1_B, + .src = true, + .state_func = bsrc_state_release, +}; + +/* Test Purpose: + * Verify that a Broadcast Source IUT can release a broadcast + * Audio Stream and transition from Configured state to Idle + * state. + * + * Pass verdict: + * The IUT stops transmitting periodic advertising. + */ +static void test_bsrc_scc_release(void) +{ + define_test("BAP/BSRC/SCC/BV-37-C [Releases Broadcast]", + NULL, test_bcast, &cfg_bsrc_8_1_1_release, IOV_NULL); +} + static void test_bsrc_scc(void) { test_bsrc_scc_config(); test_bsrc_scc_estab(); test_bsrc_scc_disable(); + test_bsrc_scc_release(); } static struct test_config cfg_bsnk_8_1 = {