All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v2 0/1] iso-tester: Add test for bcast receiver defer setup
@ 2023-08-17  6:48 Iulia Tanasescu
  2023-08-17  6:48 ` [PATCH BlueZ v2 1/1] " Iulia Tanasescu
  2023-08-17 19:50 ` [PATCH BlueZ v2 0/1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 5+ messages in thread
From: Iulia Tanasescu @ 2023-08-17  6:48 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: claudia.rosu, mihai-octavian.urzica, silviu.barbulescu,
	vlad.pruteanu, andrei.istodorescu, Iulia Tanasescu

This adds the following test to validate defer setup support for the
Broadcast Receiver scenario:

ISO Broadcaster Receiver Defer - Success

This patch depends on the kernel support introduced by
https://patchwork.kernel.org/project/bluetooth/cover/20230817064427.3647-1-iulia.tanasescu@nxp.com/

This patch version fixes CheckPatch errors.

Iulia Tanasescu (1):
  iso-tester: Add test for bcast receiver defer setup

 tools/iso-tester.c | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)


base-commit: f4aea37ee6cf6b6cb3f91e4d4c9f09611acfd610
-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH BlueZ 1/1] iso-tester: Add test for bcast receiver defer setup
@ 2023-08-16 15:09 Iulia Tanasescu
  2023-08-16 16:37 ` bluez.test.bot
  0 siblings, 1 reply; 5+ messages in thread
From: Iulia Tanasescu @ 2023-08-16 15:09 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: claudia.rosu, mihai-octavian.urzica, silviu.barbulescu,
	vlad.pruteanu, andrei.istodorescu, Iulia Tanasescu

This adds the following test to validate defer setup support for the
Broadcast Receiver scenario:

ISO Broadcaster Receiver Defer - Success

---
 tools/iso-tester.c | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/tools/iso-tester.c b/tools/iso-tester.c
index b1a2afba0..d5d2284ab 100644
--- a/tools/iso-tester.c
+++ b/tools/iso-tester.c
@@ -1134,6 +1134,15 @@ static const struct iso_client_data bcast_enc_16_2_1_recv = {
 	.server = true,
 };
 
+static const struct iso_client_data bcast_16_2_1_recv_defer = {
+	.qos = QOS_IN_16_2_1,
+	.expect_err = 0,
+	.defer = true,
+	.recv = &send_16_2_1,
+	.bcast = true,
+	.server = true,
+};
+
 static const struct iso_client_data bcast_ac_12 = {
 	.qos = BCAST_AC_12,
 	.expect_err = 0,
@@ -2341,11 +2350,15 @@ static void setup_listen(struct test_data *data, uint8_t num, GIOFunc func)
 	}
 }
 
+static gboolean iso_accept_cb(GIOChannel *io, GIOCondition cond,
+							gpointer user_data);
+
 static bool iso_defer_accept(struct test_data *data, GIOChannel *io)
 {
 	int sk;
 	char c;
 	struct pollfd pfd;
+	const struct iso_client_data *isodata = data->test_data;
 
 	sk = g_io_channel_unix_get_fd(io);
 
@@ -2368,7 +2381,13 @@ static bool iso_defer_accept(struct test_data *data, GIOChannel *io)
 	tester_print("Accept deferred setup");
 
 	data->io = io;
-	data->io_id[0] = g_io_add_watch(io, G_IO_OUT, iso_connect_cb, NULL);
+
+	if (isodata->bcast) {
+		data->io_id[0] = g_io_add_watch(io, G_IO_IN, iso_accept_cb, NULL);
+		data->step++;
+	} else {
+		data->io_id[0] = g_io_add_watch(io, G_IO_OUT, iso_connect_cb, NULL);
+	}
 
 	return true;
 }
@@ -2400,6 +2419,11 @@ static gboolean iso_accept_cb(GIOChannel *io, GIOCondition cond,
 			return false;
 		}
 
+		if (isodata->bcast && data->step > 1) {
+			data->step--;
+			goto connect;
+		}
+
 		if (!iso_defer_accept(data, io)) {
 			tester_warn("Unable to accept deferred setup");
 			tester_test_failed();
@@ -2419,6 +2443,7 @@ static gboolean iso_accept_cb(GIOChannel *io, GIOCondition cond,
 		}
 	}
 
+connect:
 	return iso_connect(io, cond, user_data);
 }
 
@@ -2963,6 +2988,9 @@ int main(int argc, char *argv[])
 							&bcast_enc_16_2_1_recv,
 							setup_powered,
 							test_bcast_recv);
+	test_iso("ISO Broadcaster Receiver Defer - Success", &bcast_16_2_1_recv_defer,
+							setup_powered,
+							test_bcast_recv);
 
 	test_iso("ISO Broadcaster AC 12 - Success", &bcast_ac_12, setup_powered,
 							test_bcast);
-- 
2.34.1


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

end of thread, other threads:[~2023-08-17 19:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-17  6:48 [PATCH BlueZ v2 0/1] iso-tester: Add test for bcast receiver defer setup Iulia Tanasescu
2023-08-17  6:48 ` [PATCH BlueZ v2 1/1] " Iulia Tanasescu
2023-08-17  8:22   ` bluez.test.bot
2023-08-17 19:50 ` [PATCH BlueZ v2 0/1] " patchwork-bot+bluetooth
  -- strict thread matches above, loose matches on Subject: below --
2023-08-16 15:09 [PATCH BlueZ 1/1] " Iulia Tanasescu
2023-08-16 16:37 ` bluez.test.bot

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.