Re: [PATCH BlueZ 1/2] shared/tester: add ability to shutdown tester IO

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

 



Hi Kirill,

On Thu, Jun 19, 2025 at 11:34 AM Kirill Samburskiy <k.samburskiy@xxxxxx> wrote:
>
> Some tests may require the ability to shutdown IO for proper teardown.
> Add function tester_shutdown_io to accomplish that.
> ---
>  src/shared/tester.c | 6 ++++++
>  src/shared/tester.h | 1 +
>  2 files changed, 7 insertions(+)
>
> diff --git a/src/shared/tester.c b/src/shared/tester.c
> index 371ccaced..230e9ef75 100644
> --- a/src/shared/tester.c
> +++ b/src/shared/tester.c
> @@ -1047,6 +1047,12 @@ struct io *tester_setup_io(const struct iovec *iov, int iovcnt)
>         return ios[0];
>  }
>
> +void tester_shutdown_io(void)
> +{
> +       io_shutdown(ios[0]);
> +       io_shutdown(ios[1]);
> +}

We might as well just done it in tester_result, something like this:

diff --git a/src/shared/tester.c b/src/shared/tester.c
index 230e9ef7579e..62a14d0732c8 100644
--- a/src/shared/tester.c
+++ b/src/shared/tester.c
@@ -654,6 +654,8 @@ static void test_result(enum test_result result)
                test->timeout_id = 0;
        }

+       tester_shutdown_io();
+
        if (test->result == TEST_RESULT_FAILED)
                result = TEST_RESULT_FAILED;

That said, it appears it uncovered some other issues after Ive done that.

>  void tester_io_send(void)
>  {
>         struct test_case *test = tester_get_test();
> diff --git a/src/shared/tester.h b/src/shared/tester.h
> index 1f8138434..dfc1ca3a8 100644
> --- a/src/shared/tester.h
> +++ b/src/shared/tester.h
> @@ -81,5 +81,6 @@ void tester_wait(unsigned int seconds, tester_wait_func_t func,
>                                                         void *user_data);
>
>  struct io *tester_setup_io(const struct iovec *iov, int iovcnt);
> +void tester_shutdown_io(void);
>  void tester_io_send(void);
>  void tester_io_set_complete_func(tester_data_func_t func);
> --
> 2.34.1
>
>


-- 
Luiz Augusto von Dentz





[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