iso-tester: Add ISO Reconnect Send and Receive #16
Luiz Augusto von Dentz
maintainerPATCH 1/1 iso-tester: Add ISO Reconnect Send and Receive #16
From: Luiz Augusto von Dentz <[email protected]>
This adds ISO Reconnect Send and Receive #16 which test reconnecting, send/receive datas, 16 times to stress test the handling of reconnecting logic and confirm tha POLLOUT is generated everytime:
ISO Reconnect Send and Receive #16 - Success - run
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle 0x0101: 0x00 New client connection with handle 0x0101 Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle 0x0101 disconnected
Successfully disconnected
Reconnecting #16...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle 0x0101: 0x00 New client connection with handle 0x0101 Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle 0x0101 disconnected
Successfully disconnected
Reconnecting #15...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle 0x0101: 0x00 New client connection with handle 0x0101 Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle 0x0101 disconnected
Successfully disconnected
Reconnecting #14...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle 0x0101: 0x00 New client connection with handle 0x0101 Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle 0x0101 disconnected
Successfully disconnected
Reconnecting #13...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle 0x0101: 0x00 New client connection with handle 0x0101 Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle 0x0101 disconnected
Successfully disconnected
Reconnecting #12...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle 0x0101: 0x00 New client connection with handle 0x0101 Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle 0x0101 disconnected
Successfully disconnected
Reconnecting #11...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle 0x0101: 0x00 New client connection with handle 0x0101 Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle 0x0101 disconnected
Successfully disconnected
Reconnecting #10...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle 0x0101: 0x00 New client connection with handle 0x0101 Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle 0x0101 disconnected
Successfully disconnected
Reconnecting #9...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle 0x0101: 0x00 New client connection with handle 0x0101 Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle 0x0101 disconnected
Successfully disconnected
Reconnecting #8...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle 0x0101: 0x00 New client connection with handle 0x0101 Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle 0x0101 disconnected
Successfully disconnected
Reconnecting #7...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle 0x0101: 0x00 New client connection with handle 0x0101 Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle 0x0101 disconnected
Successfully disconnected
Reconnecting #6...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle 0x0101: 0x00 New client connection with handle 0x0101 Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle 0x0101 disconnected
Successfully disconnected
Reconnecting #5...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle 0x0101: 0x00 New client connection with handle 0x0101 Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle 0x0101 disconnected
Successfully disconnected
Reconnecting #4...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle 0x0101: 0x00 New client connection with handle 0x0101 Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle 0x0101 disconnected
Successfully disconnected
Reconnecting #3...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle 0x0101: 0x00 New client connection with handle 0x0101 Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle 0x0101 disconnected
Successfully disconnected
Reconnecting #2...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle 0x0101: 0x00 New client connection with handle 0x0101 Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle 0x0101 disconnected
Successfully disconnected
Reconnecting #1...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle 0x0101: 0x00 New client connection with handle 0x0101 Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle 0x0101 disconnected
Successfully disconnected
ISO Reconnect Send and Receive #16 - Success - test passed
--- tools/iso-tester.c | 171 +++++++++++++++++++++++++++------------------ 1 file changed, 104 insertions(+), 67 deletions(-)
tools/iso-tester.c +104 -67
@@ -474,7 +474,7 @@ struct test_data {unsigned int io_id[4 ];uint8_t client_num;int step; -bool reconnect; +uint8_t reconnect;bool suspending;struct tx_tstamp_data tx_ts;int seqnum;
@@ -1189,6 +1189,14 @@ static const struct iso_client_data reconnect_16_2_1 = { .disconnect = true, }; +static const struct iso_client_data reconnect_16_2_1_send_recv = { + .qos =QOS_16_2_1 , + .expect_err =0 , + .send = &send_16_2_1, + .recv = &send_16_2_1, + .disconnect = true, +}; +static const struct iso_client_data connect_ac_1_4 = { .qos =AC_1_4 , .expect_err =0
@@ -1616,9 +1624,8 @@ static void bthost_recv_data(const void *buf, uint16_t len, void *user_data) memcmp(isodata->send->iov_base, buf, len))) {if (!isodata->recv->iov_base)tester_test_failed (); - } else if (!data->step) { + } else if (!data->step)tester_test_passed (); - } }static void bthost_iso_disconnected (void *user_data)
@@ -2198,6 +2205,71 @@ static bool check_bcast_qos(const struct bt_iso_qos *qos1,return true; } +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 bool iso_defer_accept_bcast (struct test_data *data,GIOChannel *io, +uint8_t num,GIOFunc func); + +static gboolean iso_disconnected (GIOChannel *io,GIOCondition cond, +gpointer user_data) +{ +struct test_data *data = user_data; +const struct iso_client_data *isodata = data->test_data; + + data->io_id[0 ] =0 ; + +if (cond &G_IO_HUP ) { +if (!isodata->bcast && data->handle) +tester_test_failed (); + +tester_print ("Successfully disconnected" ); + +if (data->reconnect) { +tester_print ("Reconnecting #%u..." , data->reconnect); + + data->reconnect--; + +if (!isodata->server) +test_connect (data->test_data); +else { +GIOChannel *parent = +queue_peek_head (data->io_queue); + + data->step++; + +iso_defer_accept_bcast (data, + parent,0 , iso_accept_cb); + } + +return FALSE; + } + +tester_test_passed (); + }else +tester_test_failed (); + +return FALSE; +} + +static void iso_shutdown (struct test_data *data,GIOChannel *io) +{ +int sk; + + sk =g_io_channel_unix_get_fd (io); + + data->io_id[0 ] =g_io_add_watch (io,G_IO_HUP , iso_disconnected, data); + +/* Shutdown using SHUT_WR as SHUT_RDWR cause the socket to HUP +* immediately instead of waiting for Disconnect Complete event. +*/ +shutdown (sk,SHUT_WR ); + +tester_print ("Disconnecting..." ); +} +static gboolean iso_recv_data (GIOChannel *io,GIOCondition cond,gpointer user_data) {
@@ -2305,6 +2377,8 @@ static gboolean iso_recv_data(GIOChannel *io, GIOCondition cond,tester_test_failed (); else if (data->step) return TRUE; + else if (isodata->disconnect) + iso_shutdown(data, io); elsetester_test_passed ();
@@ -2439,11 +2513,17 @@ static void iso_send_data(struct test_data *data, GIOChannel *io) data->step++; } -static void iso_send (struct test_data *data,GIOChannel *io) +static gboolean iso_pollout (GIOChannel *io,GIOCondition cond, +gpointer user_data) { +struct test_data *data = user_data;const struct iso_client_data *isodata = data->test_data;unsigned int count; + data->io_id[0 ] =0 ; + +tester_print ("POLLOUT event received" ); +for (count =0 ; count < isodata->repeat_send_pre_ts; ++count)iso_send_data (data, io);
@@ -2454,74 +2534,18 @@ static void iso_send(struct test_data *data, GIOChannel *io)if (isodata->bcast) {tester_test_passed (); -return ; +return FALSE; }if (isodata->recv)iso_recv (data, 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 bool iso_defer_accept_bcast (struct test_data *data,GIOChannel *io, -uint8_t num,GIOFunc func); - -static gboolean iso_disconnected (GIOChannel *io,GIOCondition cond, -gpointer user_data) -{ -struct test_data *data = user_data; -const struct iso_client_data *isodata = data->test_data; - - data->io_id[0 ] =0 ; - -if (cond &G_IO_HUP ) { -if (!isodata->bcast && data->handle) -tester_test_failed (); - -tester_print ("Successfully disconnected" ); - -if (data->reconnect) { - data->reconnect = false; - -if (!isodata->server) -test_connect (data->test_data); -else { -GIOChannel *parent = -queue_peek_head (data->io_queue); - - data->step++; - -iso_defer_accept_bcast (data, - parent,0 , iso_accept_cb); - } - -return FALSE; - } - -tester_test_passed (); - }else -tester_test_failed ();return FALSE; } -static void iso_shutdown (struct test_data *data,GIOChannel *io) +static void iso_send (struct test_data *data,GIOChannel *io) { -int sk; - - sk =g_io_channel_unix_get_fd (io); - - data->io_id[0 ] =g_io_add_watch (io,G_IO_HUP , iso_disconnected, data); - -/* Shutdown using SHUT_WR as SHUT_RDWR cause the socket to HUP -* immediately instead of waiting for Disconnect Complete event. -*/ -shutdown (sk,SHUT_WR ); - -tester_print ("Disconnecting..." ); + data->io_id[0 ] =g_io_add_watch (io,G_IO_OUT , iso_pollout, data); }static bool hook_set_event_mask (const void *msg,uint16_t len,void *user_data)
@@ -2855,7 +2879,15 @@ static void test_reconnect(const void *test_data) {struct test_data *data =tester_get_data (); - data->reconnect = true; + data->reconnect =1 ; +test_connect (test_data); +} + +static void test_reconnect_16 (const void *test_data) +{ +struct test_data *data =tester_get_data (); + + data->reconnect =16 ;test_connect (test_data); }
@@ -3490,7 +3522,7 @@ static void test_bcast_reconnect(const void *test_data) {struct test_data *data =tester_get_data (); - data->reconnect = true; + data->reconnect =1 ;setup_connect (data,0 , iso_connect_cb); }
@@ -3511,7 +3543,7 @@ static void test_bcast2_reconn(const void *test_data) data->io_queue =queue_new (); - data->reconnect = true; + data->reconnect =1 ;setup_connect_many (data,2 , num, funcs); }
@@ -3544,7 +3576,7 @@ static void test_bcast_recv_defer_reconnect(const void *test_data) {struct test_data *data =tester_get_data (); - data->reconnect = true; + data->reconnect =1 ; data->step =1 ;setup_listen (data,0 , iso_accept_cb);
@@ -3878,6 +3910,11 @@ int main(int argc, char *argv[]) setup_powered, test_reconnect); +test_iso ("ISO Reconnect Send and Receive #16 - Success" , + &reconnect_16_2_1_send_recv, + setup_powered, + test_reconnect_16); +test_iso ("ISO AC 1 & 4 - Success" , &connect_ac_1_4, setup_powered, test_connect);
Signature · 1 line
2.50.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=989510
---Test result---
Test Summary:
CheckPatch PENDING 0.28 seconds GitLint PENDING 0.32 seconds BuildEll PASS 20.33 seconds BluezMake PASS 2820.97 seconds MakeCheck PASS 19.96 seconds MakeDistcheck PASS 192.28 seconds CheckValgrind PASS 243.96 seconds CheckSmatch PASS 314.48 seconds bluezmakeextell PASS 132.17 seconds IncrementalBuild PENDING 0.19 seconds ScanBuild PASS 957.75 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series Output:
---
Regards,
Linux Bluetooth
This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:
Hello:
This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:
Quoted 229 lines · On Fri, 8 Aug 2025 15:10:53 -0400 you wrote:
From: Luiz Augusto von Dentz <[email protected]>
This adds ISO Reconnect Send and Receive #16 which test reconnecting, send/receive datas, 16 times to stress test the handling of reconnecting logic and confirm tha POLLOUT is generated everytime:
ISO Reconnect Send and Receive #16 - Success - run
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle0x0101:0x00New client connection with handle0x0101Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle0x0101disconnected
Successfully disconnected
Reconnecting #16...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle0x0101:0x00New client connection with handle0x0101Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle0x0101disconnected
Successfully disconnected
Reconnecting #15...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle0x0101:0x00New client connection with handle0x0101Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle0x0101disconnected
Successfully disconnected
Reconnecting #14...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle0x0101:0x00New client connection with handle0x0101Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle0x0101disconnected
Successfully disconnected
Reconnecting #13...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle0x0101:0x00New client connection with handle0x0101Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle0x0101disconnected
Successfully disconnected
Reconnecting #12...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle0x0101:0x00New client connection with handle0x0101Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle0x0101disconnected
Successfully disconnected
Reconnecting #11...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle0x0101:0x00New client connection with handle0x0101Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle0x0101disconnected
Successfully disconnected
Reconnecting #10...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle0x0101:0x00New client connection with handle0x0101Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle0x0101disconnected
Successfully disconnected
Reconnecting #9...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle0x0101:0x00New client connection with handle0x0101Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle0x0101disconnected
Successfully disconnected
Reconnecting #8...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle0x0101:0x00New client connection with handle0x0101Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle0x0101disconnected
Successfully disconnected
Reconnecting #7...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle0x0101:0x00New client connection with handle0x0101Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle0x0101disconnected
Successfully disconnected
Reconnecting #6...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle0x0101:0x00New client connection with handle0x0101Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle0x0101disconnected
Successfully disconnected
Reconnecting #5...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle0x0101:0x00New client connection with handle0x0101Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle0x0101disconnected
Successfully disconnected
Reconnecting #4...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle0x0101:0x00New client connection with handle0x0101Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle0x0101disconnected
Successfully disconnected
Reconnecting #3...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle0x0101:0x00New client connection with handle0x0101Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle0x0101disconnected
Successfully disconnected
Reconnecting #2...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle0x0101:0x00New client connection with handle0x0101Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle0x0101disconnected
Successfully disconnected
Reconnecting #1...
Connecting to 00:AA:01:01:00:00...
Connect 0 in progress
Accept client connection with handle0x0101:0x00New client connection with handle0x0101Successfully connected
POLLOUT event received
Writing 40 bytes of data
Receive 40 bytes of data
Client received 40 bytes of data Disconnecting...
ISO handle0x0101disconnected
Successfully disconnected
ISO Reconnect Send and Receive #16 - Success - test passed
Quoted 1 line
[...]
Here is the summary with links:
- [BlueZ,v1] iso-tester: Add ISO Reconnect Send and Receive #16
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=10977abda3f8
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html