diff mbox series

[BlueZ,v2,1/1] iso-tester: Add test for bcast receiver defer setup

Message ID 20230817064853.3706-2-iulia.tanasescu@nxp.com (mailing list archive)
State Accepted
Commit 60731cab5891ad2be01f5fcdbf5908aff7df4fd1
Headers show
Series iso-tester: Add test for bcast receiver defer setup | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake success Bluez Make PASS
tedd_an/MakeCheck success Bluez Make Check PASS
tedd_an/MakeDistcheck success Make Distcheck PASS
tedd_an/CheckValgrind success Check Valgrind PASS
tedd_an/CheckSmatch success CheckSparse PASS
tedd_an/bluezmakeextell success Make External ELL PASS
tedd_an/IncrementalBuild success Incremental Build PASS
tedd_an/ScanBuild success Scan Build PASS

Commit Message

Iulia Tanasescu Aug. 17, 2023, 6:48 a.m. UTC
This adds the following test to validate defer setup support for the
Broadcast Receiver scenario:

ISO Broadcaster Receiver Defer - Success

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

Comments

bluez.test.bot@gmail.com Aug. 17, 2023, 8:22 a.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=776877

---Test result---

Test Summary:
CheckPatch                    PASS      0.50 seconds
GitLint                       PASS      0.31 seconds
BuildEll                      PASS      29.99 seconds
BluezMake                     PASS      1082.29 seconds
MakeCheck                     PASS      12.11 seconds
MakeDistcheck                 PASS      173.12 seconds
CheckValgrind                 PASS      273.89 seconds
CheckSmatch                   PASS      389.45 seconds
bluezmakeextell               PASS      112.12 seconds
IncrementalBuild              PASS      922.77 seconds
ScanBuild                     PASS      1204.73 seconds



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/tools/iso-tester.c b/tools/iso-tester.c
index b1a2afba0..75edc4380 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,
@@ -1865,6 +1874,8 @@  static void iso_send(struct test_data *data, GIOChannel *io)
 static void test_connect(const void *test_data);
 static gboolean iso_connect_cb(GIOChannel *io, GIOCondition cond,
 							gpointer user_data);
+static gboolean iso_accept_cb(GIOChannel *io, GIOCondition cond,
+							gpointer user_data);
 
 static gboolean iso_disconnected(GIOChannel *io, GIOCondition cond,
 							gpointer user_data)
@@ -2346,6 +2357,7 @@  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 +2380,15 @@  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 +2420,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 +2444,7 @@  static gboolean iso_accept_cb(GIOChannel *io, GIOCondition cond,
 		}
 	}
 
+connect:
 	return iso_connect(io, cond, user_data);
 }
 
@@ -2963,6 +2989,10 @@  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);