All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/4] iso-tester: Add tests for AC configuration reconnect
@ 2023-05-28 17:39 Pauli Virtanen
  2023-05-28 17:39 ` [PATCH BlueZ 2/4] btdev: fix inactive CIG configurable status Pauli Virtanen
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Pauli Virtanen @ 2023-05-28 17:39 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Pauli Virtanen

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-05-30 18:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-28 17:39 [PATCH BlueZ 1/4] iso-tester: Add tests for AC configuration reconnect Pauli Virtanen
2023-05-28 17:39 ` [PATCH BlueZ 2/4] btdev: fix inactive CIG configurable status Pauli Virtanen
2023-05-28 17:39 ` [PATCH BlueZ 3/4] btdev: check LE Create CIS error conditions Pauli Virtanen
2023-05-28 17:39 ` [PATCH BlueZ 4/4] test-runner: enable no_hash_pointers=1 Pauli Virtanen
2023-05-28 20:07 ` [BlueZ,1/4] iso-tester: Add tests for AC configuration reconnect bluez.test.bot
2023-05-30 18:40 ` [PATCH BlueZ 1/4] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.