Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2231043rwd; Sun, 28 May 2023 10:48:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ48scjLoayQsha8L9FIJBDAbHjI+b8ltMZKwcQG6knvTXhko10zUodC37eCnH1ezU9MgBf6 X-Received: by 2002:a17:903:2452:b0:19e:6e00:4676 with SMTP id l18-20020a170903245200b0019e6e004676mr10248476pls.61.1685296116348; Sun, 28 May 2023 10:48:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685296116; cv=none; d=google.com; s=arc-20160816; b=QGqtR1mjkbH4AeZZRog3dusstxHmdQYH4YBnyb869dtXLgLybkBYYV9r5bdDzg6X1p yraEd/k6ZBjc1VBMWJkY4phZn5clPk/kkokMSlyfEct0mVXkI4uoIZcSrB/qRi1CnZ2+ Si5uevCOE0sPZ38K1vDzm6OD/D21S2PAzGphjxD2CkRsH4mXsxtDjX/Q19nNzj4ozjew K7+6Jcd8DwfmMvY4JKVrR77wA4nR3T/chJL9DFchcWG5mWWJGNRtnenbtVpLvSlnzQPP ofo2Ucr5jRFn4TY8bFdZxgRe+jc/1S3x3v6e7dW9OIMfcfxQd2VAIql70euf1L9ortto U6xg== 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 :message-id:date:subject:cc:to:from; bh=oGs0dU/zUOmWYFg7xU9hu7wx9oGkDSSq3+1ae5r5tgQ=; b=eJYR2PKves40E9y9ddk+p3MgmpbPtrYxK66lmmf5kW+Xw0TDMtDJE9adu8qMgZmS6J lwJMJI8ihDgzP4gRL099sNmdyWfeYAP31QbobKdSk/gW8BAsU5S9HDrq5jUl4gXX5TWX 4KVGECgwT94lMzXEpWHDCtpmTK80eJx5FfGbm5H0g6s3PZWRMm/ujYsTjmsUzs/YrDwA RsGixkFSMoGXrBLZ9J69eJ/178WP0hQzgM4EEJZW5/oSGSuFrUGI/X6Fgpl641uvCrws V0MHTtv4ZRelEGa/xrzpwVAagNs2E0sZ/m8DOh6WkyTgCFg930ihBa89uchQ1F00aIbU rrww== 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 q16-20020a170902edd000b001b027afdef5si3290386plk.231.2023.05.28.10.48.22; Sun, 28 May 2023 10:48:36 -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 S229530AbjE1Rjf (ORCPT + 99 others); Sun, 28 May 2023 13:39:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbjE1Rje (ORCPT ); Sun, 28 May 2023 13:39:34 -0400 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EDC4D8 for ; Sun, 28 May 2023 10:39:21 -0700 (PDT) Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id DA38C240028 for ; Sun, 28 May 2023 19:39:18 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QTm9y1lCwz6tm4; Sun, 28 May 2023 19:39:18 +0200 (CEST) From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ 1/4] iso-tester: Add tests for AC configuration reconnect Date: Sun, 28 May 2023 17:39:13 +0000 Message-Id: <502997002ac9d4a76593aa4ba8237b7fb803c701.1685283364.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 test for reconnecting a CIG with two CIS, either both with same peer or with different peers. ISO Reconnect AC 6(i) - Success ISO Reconnect AC 6(ii) - Success --- Notes: The intent here was to trigger the kernel to send Remove CIG and Set CIG Parameters in the wrong order, but it doesn't hit the right timing in the emulator. It occurs on real hardware when BlueZ recreates multiple CIS at the same time. This can occur because Remove CIG is sent via hci_sync queue and queueing its request may be delayed until hci_cmd_sync_work runs, whereas Set CIG Parameters request is queued directly via hci_send_cmd. However, these tests were useful to have, as they hit Create CIS timing issues if Set CIG Parameters is moved to hci_sync. tools/iso-tester.c | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/tools/iso-tester.c b/tools/iso-tester.c index 63c37bd52..776d87fc1 100644 --- a/tools/iso-tester.c +++ b/tools/iso-tester.c @@ -839,6 +839,15 @@ static const struct iso_client_data connect_ac_6i = { .defer = true, }; +static const struct iso_client_data reconnect_ac_6i = { + .qos = AC_6i_1, + .qos_2 = AC_6i_2, + .expect_err = 0, + .mcis = true, + .defer = true, + .disconnect = true, +}; + static const struct iso_client_data connect_ac_6ii = { .qos = AC_6ii_1, .qos_2 = AC_6ii_2, @@ -847,6 +856,15 @@ static const struct iso_client_data connect_ac_6ii = { .defer = true, }; +static const struct iso_client_data reconnect_ac_6ii = { + .qos = AC_6ii_1, + .qos_2 = AC_6ii_2, + .expect_err = 0, + .mcis = true, + .defer = true, + .disconnect = true, +}; + static const struct iso_client_data connect_ac_7i = { .qos = AC_7i_1, .qos_2 = AC_7i_2, @@ -1626,7 +1644,7 @@ static void iso_send(struct test_data *data, GIOChannel *io) iso_recv(data, io); } -static void setup_connect(struct test_data *data, uint8_t num, GIOFunc func); +static void test_connect(const void *test_data); static gboolean iso_connect_cb(GIOChannel *io, GIOCondition cond, gpointer user_data); @@ -1642,7 +1660,7 @@ static gboolean iso_disconnected(GIOChannel *io, GIOCondition cond, if (data->reconnect) { data->reconnect = false; - setup_connect(data, 0, iso_connect_cb); + test_connect(data->test_data); return FALSE; } @@ -1885,17 +1903,12 @@ static void test_connect(const void *test_data) setup_connect_many(data, n, num, func); } -static void setup_reconnect(struct test_data *data, uint8_t num, GIOFunc func) -{ - data->reconnect = true; - setup_connect(data, num, func); -} - static void test_reconnect(const void *test_data) { struct test_data *data = tester_get_data(); - setup_reconnect(data, 0, iso_connect_cb); + data->reconnect = true; + test_connect(test_data); } static void test_defer(const void *test_data) @@ -2410,6 +2423,14 @@ int main(int argc, char *argv[]) setup_powered, test_connect2_seq); + test_iso2("ISO Reconnect AC 6(i) - Success", &reconnect_ac_6i, + setup_powered, + test_reconnect); + + test_iso2("ISO Reconnect AC 6(ii) - Success", &reconnect_ac_6ii, + setup_powered, + test_reconnect); + test_iso("ISO Broadcaster - Success", &bcast_16_2_1_send, setup_powered, test_bcast); test_iso("ISO Broadcaster Encrypted - Success", &bcast_enc_16_2_1_send, -- 2.40.1