Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1903189rwd; Sun, 21 May 2023 08:32:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4V7eX/HAKNX87IlHJwbacvWkg9VtE4fBBlodqDXADTjENzWahGWUMep3zeJGR2VbZNCpuy X-Received: by 2002:a05:6a00:2405:b0:640:f313:efba with SMTP id z5-20020a056a00240500b00640f313efbamr9976934pfh.19.1684683127779; Sun, 21 May 2023 08:32:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684683127; cv=none; d=google.com; s=arc-20160816; b=kXB/pvcx3WJNNS1SnXL3QIEYS+zTdooP6lIJ0ZMg5KXX8KxMEOMj6DTk4BTwsc/va2 lU8UP2s5YnB7zaeKr8urZQ6rnJ0SQFOkRMFLkJuZo9AZY0s1Bs9p08sWX8Hw+0HK7+bh Uv25DqSSoZtK0LOdMdvNkmW9nx68QY9WErWTPlg7WCxyBOUjSRAzLjckz6tuy1hxiQr1 9c23vlfEKnEVsfjiwWqUwUf0blem0IHB+88TeVlfacdf7jQoZEOtzOsY2Y0WtPDTQt3n lmWIpBI9CFWm4F+N6KbxDsP1lTs+eCvdFTKQsyrRvbUCRwvNlyhEsMVNxSSa0qVpHigj o40g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=yi7YYqLDib+T1wE6Fd3ARjXjxowuiO7zx2KE2CBGP7g=; b=jldmF19U0sEtDyCyFL1KDEiOUesv21fIo2pWRCmqmhd6Q53XgFOXVwiZqDk4pXPMIv P1O8hlWIBHdnwpDXnTLxDPGFPiGB7xwI2u3zaNFTgrUEBUSDZRz+yzzdh9lj4zMT/uO9 yvF5hiXLvDQKU1DqC/erkIB7qRHEMVOz4WrM6mLWO5jdrgG2MNnIUCOKblRvbBP52+FV q7NSuEOzqdzoYufkjPlG1tuMtQCVyQy3bEXKiccvmIrgWNodMzaQTKcb7l8MCn8irqmD rdSY3VHfCQGlXRt7fejj5B98hbcOxeMBXz2RmTSnEZ277KpvrFswpKoEzW3L8sz3Ct+U vrbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x13-20020aa7956d000000b0064d3a447717si3236918pfq.273.2023.05.21.08.31.55; Sun, 21 May 2023 08:32:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229999AbjEUP1r (ORCPT + 99 others); Sun, 21 May 2023 11:27:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbjEUP1p (ORCPT ); Sun, 21 May 2023 11:27:45 -0400 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6DB2D7 for ; Sun, 21 May 2023 08:27:43 -0700 (PDT) Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 4BA03240101 for ; Sun, 21 May 2023 17:27:42 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QPPbK61Hhz9rxF; Sun, 21 May 2023 17:27:41 +0200 (CEST) From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ 5/5] iso-tester: add tests for multiple simultaneous CIG Date: Sun, 21 May 2023 15:27:38 +0000 Message-Id: In-Reply-To: <024df2d86c14fc811701ba27bfa576476bc9c0d6.1684682575.git.pav@iki.fi> References: <024df2d86c14fc811701ba27bfa576476bc9c0d6.1684682575.git.pav@iki.fi> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NEUTRAL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Add tests connecting two CIS using different CIG_ID, with fixed and auto-allocated IDs. ISO Connect2 CIG 0x01/0x02 Seq - Success ISO Connect2 CIG auto/auto Seq - Success The CIS are connected sequentially so that the first is closed after the second is connected. In the auto/auto case the kernel shall pick a new CIG_ID since the first CIG_ID is no longer in a configurable state. --- Notes: The second tests hits a bug in kernel CIG auto-allocation, which always picks CIG_ID 0 even if it is not in a configurable state. ISO Connect2 CIG auto/auto Seq - Success - setup complete ISO Connect2 CIG auto/auto Seq - Success - run Connecting to 00:AA:01:01:00:00... Connect 0 in progress Connecting to 00:AA:01:02:00:01... Connect 1 in progress Successfully connected Step 1 Connect failed: Device or resource busy (16) Expect error: Success (0) != Device or resource busy (16) tools/iso-tester.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tools/iso-tester.c b/tools/iso-tester.c index 164cb465f..fc2a84215 100644 --- a/tools/iso-tester.c +++ b/tools/iso-tester.c @@ -64,6 +64,11 @@ QOS_IO(_interval, _latency, _sdu, _phy, _rtn), \ QOS_IO(_interval, _latency, _sdu, _phy, _rtn)) +#define QOS_2(_interval, _latency, _sdu, _phy, _rtn) \ + QOS_FULL(0x02, BT_ISO_QOS_CIS_UNSET, \ + QOS_IO(_interval, _latency, _sdu, _phy, _rtn), \ + QOS_IO(_interval, _latency, _sdu, _phy, _rtn)) + #define QOS_1_1(_interval, _latency, _sdu, _phy, _rtn) \ QOS_FULL(0x01, 0x01, \ QOS_IO(_interval, _latency, _sdu, _phy, _rtn), \ @@ -109,6 +114,7 @@ #define QOS_16_1_1 QOS(7500, 8, 30, 0x02, 2) #define QOS_16_2_1 QOS(10000, 10, 40, 0x02, 2) #define QOS_1_16_2_1 QOS_1(10000, 10, 40, 0x02, 2) +#define QOS_2_16_2_1 QOS_2(10000, 10, 40, 0x02, 2) #define QOS_1_1_16_2_1 QOS_1_1(10000, 10, 40, 0x02, 2) #define QOS_24_1_1 QOS(7500, 8, 45, 0x02, 2) #define QOS_24_2_1 QOS(10000, 10, 60, 0x02, 2) @@ -546,6 +552,20 @@ static const struct iso_client_data connect_1_16_2_1 = { .expect_err = 0 }; +static const struct iso_client_data connect_2_16_2_1 = { + .qos = QOS_1_16_2_1, + .qos_2 = QOS_2_16_2_1, + .expect_err = 0, + .mcis = true, +}; + +static const struct iso_client_data connect_2a_16_2_1 = { + .qos = QOS_16_2_1, + .qos_2 = QOS_16_2_1, + .expect_err = 0, + .mcis = true, +}; + static const struct iso_client_data connect_1_1_16_2_1 = { .qos = QOS_1_1_16_2_1, .expect_err = 0 @@ -2126,6 +2146,25 @@ static void test_connect2(const void *test_data) setup_connect_many(data, 2, num, funcs); } +static gboolean iso_connect2_seq_cb(GIOChannel *io, GIOCondition cond, + gpointer user_data) +{ + struct test_data *data = tester_get_data(); + + data->io_id[0] = 0; + + setup_connect(data, 1, iso_connect2_cb); + + return iso_connect(io, cond, user_data); +} + +static void test_connect2_seq(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + setup_connect(data, 0, iso_connect2_seq_cb); +} + static void test_bcast(const void *test_data) { struct test_data *data = tester_get_data(); @@ -2264,6 +2303,15 @@ int main(int argc, char *argv[]) test_iso("ISO QoS - Invalid", &connect_invalid, setup_powered, test_connect); + test_iso2("ISO Connect2 CIG 0x01/0x02 Seq - Success", &connect_2_16_2_1, + setup_powered, + test_connect2_seq); + + test_iso2("ISO Connect2 CIG auto/auto Seq - Success", + &connect_2a_16_2_1, + setup_powered, + test_connect2_seq); + test_iso_rej("ISO Connect - Reject", &connect_reject, setup_powered, test_connect, BT_HCI_ERR_CONN_FAILED_TO_ESTABLISH); -- 2.40.1