[PATCH BlueZ 1/4] iso-tester: Add tests for AC configuration reconnect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux