mbox series

[00/11] selftests: ublk: bug fixes & consolidation

Message ID 20250303124324.3563605-1-ming.lei@redhat.com (mailing list archive)
Headers show
Series selftests: ublk: bug fixes & consolidation | expand

Message

Ming Lei March 3, 2025, 12:43 p.m. UTC
Hello Jens and guys,

This patchset fixes several issues(1, 2, 4) and consolidate & improve
the tests in the following ways:

- support shellcheck and fixes all warning

- misc cleanup

- improve cleanup code path(module load/unload, cleanup temp files)

- help to reuse the same test source code and scripts for other
  projects(liburing[1], blktest, ...)

- add two stress tests for covering IO workloads vs. removing device &
killing ublk server, given buffer lifetime is one big thing for ublk-zc 


[1] https://github.com/ming1/liburing/commits/ublk-zc 

- just need one line change for overriding skip_code, libring uses 77 and
  kselftests takes 4

Ming Lei (11):
  selftests: ublk: make ublk_stop_io_daemon() more reliable
  selftests: ublk: fix build failure
  selftests: ublk: add --foreground command line
  selftests: ublk: fix parsing '-a' argument
  selftests: ublk: support shellcheck and fix all warning
  selftests: ublk: don't pass ${dev_id} to _cleanup_test()
  selftests: ublk: move zero copy feature check into _add_ublk_dev()
  selftests: ublk: load/unload ublk_drv when preparing & cleaning up
    tests
  selftests: ublk: add one stress test for covering IO vs. removing
    device
  selftests: ublk: add stress test for covering IO vs. killing ublk
    server
  selftests: ublk: improve test usability

 tools/testing/selftests/ublk/Makefile         |   6 +
 tools/testing/selftests/ublk/kublk.c          |  43 +++--
 tools/testing/selftests/ublk/kublk.h          |   2 +
 tools/testing/selftests/ublk/test_common.sh   | 167 ++++++++++++++----
 tools/testing/selftests/ublk/test_loop_01.sh  |  13 +-
 tools/testing/selftests/ublk/test_loop_02.sh  |  14 +-
 tools/testing/selftests/ublk/test_loop_03.sh  |  16 +-
 tools/testing/selftests/ublk/test_loop_04.sh  |  14 +-
 tools/testing/selftests/ublk/test_null_01.sh  |   9 +-
 .../testing/selftests/ublk/test_stress_01.sh  |  47 +++++
 .../testing/selftests/ublk/test_stress_02.sh  |  47 +++++
 11 files changed, 300 insertions(+), 78 deletions(-)
 create mode 100755 tools/testing/selftests/ublk/test_stress_01.sh
 create mode 100755 tools/testing/selftests/ublk/test_stress_02.sh

Comments

Ming Lei March 10, 2025, 3:09 p.m. UTC | #1
On Mon, Mar 3, 2025 at 8:43 PM Ming Lei <ming.lei@redhat.com> wrote:
>
> Hello Jens and guys,
>
> This patchset fixes several issues(1, 2, 4) and consolidate & improve
> the tests in the following ways:
>
> - support shellcheck and fixes all warning
>
> - misc cleanup
>
> - improve cleanup code path(module load/unload, cleanup temp files)
>
> - help to reuse the same test source code and scripts for other
>   projects(liburing[1], blktest, ...)
>
> - add two stress tests for covering IO workloads vs. removing device &
> killing ublk server, given buffer lifetime is one big thing for ublk-zc
>
>
> [1] https://github.com/ming1/liburing/commits/ublk-zc
>
> - just need one line change for overriding skip_code, libring uses 77 and
>   kselftests takes 4

Hi Jens,

Can you merge this patchset if you are fine?

Thanks,
Jens Axboe March 10, 2025, 3:17 p.m. UTC | #2
On 3/10/25 9:09 AM, Ming Lei wrote:
> On Mon, Mar 3, 2025 at 8:43?PM Ming Lei <ming.lei@redhat.com> wrote:
>>
>> Hello Jens and guys,
>>
>> This patchset fixes several issues(1, 2, 4) and consolidate & improve
>> the tests in the following ways:
>>
>> - support shellcheck and fixes all warning
>>
>> - misc cleanup
>>
>> - improve cleanup code path(module load/unload, cleanup temp files)
>>
>> - help to reuse the same test source code and scripts for other
>>   projects(liburing[1], blktest, ...)
>>
>> - add two stress tests for covering IO workloads vs. removing device &
>> killing ublk server, given buffer lifetime is one big thing for ublk-zc
>>
>>
>> [1] https://github.com/ming1/liburing/commits/ublk-zc
>>
>> - just need one line change for overriding skip_code, libring uses 77 and
>>   kselftests takes 4
> 
> Hi Jens,
> 
> Can you merge this patchset if you are fine?

Yep sorry, was pondering how best to get it staged. Should go into
block, but depends on the other bits that I staged for io_uring. So I'll
just put it there, not a big deal.
Jens Axboe March 10, 2025, 3:18 p.m. UTC | #3
On Mon, 03 Mar 2025 20:43:10 +0800, Ming Lei wrote:
> This patchset fixes several issues(1, 2, 4) and consolidate & improve
> the tests in the following ways:
> 
> - support shellcheck and fixes all warning
> 
> - misc cleanup
> 
> [...]

Applied, thanks!

[01/11] selftests: ublk: make ublk_stop_io_daemon() more reliable
        commit: 9894e0eaae980df1ed3f2e86a487fe4c8ef1ab46
[02/11] selftests: ublk: fix build failure
        commit: 9d80f48c5e08b2e003e506c6e5326a35a652ea2f
[03/11] selftests: ublk: add --foreground command line
        commit: 2ecdcdfee58c028c15ed00b691104249370db075
[04/11] selftests: ublk: fix parsing '-a' argument
        commit: cf2132935639813a0b88e55074e6e52a4b82f26a
[05/11] selftests: ublk: support shellcheck and fix all warning
        commit: 30aab83035048c70e09ff058a73e8428de9bd103
[06/11] selftests: ublk: don't pass ${dev_id} to _cleanup_test()
        commit: 8da9f88fee59fe5aa99014a2621b07347edd5780
[07/11] selftests: ublk: move zero copy feature check into _add_ublk_dev()
        commit: b95b47eaa8d7c8b595d93397d1b85f1559c2d220
[08/11] selftests: ublk: load/unload ublk_drv when preparing & cleaning up tests
        commit: 9e71305495d1b79f96729b8d77d4d823a6bd998a
[09/11] selftests: ublk: add one stress test for covering IO vs. removing device
        commit: 6f3004e78b59e98a903e20e2240ae77e76dfde77
[10/11] selftests: ublk: add stress test for covering IO vs. killing ublk server
        commit: 4fcd5b5a6dff71cf82212dd208dc1765ca8a8088
[11/11] selftests: ublk: improve test usability
        commit: 22c880f446a149f5ee11260690a34d4b3f95c221

Best regards,
Ming Lei March 11, 2025, 4:35 a.m. UTC | #4
On Mon, Mar 10, 2025 at 09:17:56AM -0600, Jens Axboe wrote:
> On 3/10/25 9:09 AM, Ming Lei wrote:
> > On Mon, Mar 3, 2025 at 8:43?PM Ming Lei <ming.lei@redhat.com> wrote:
> >>
> >> Hello Jens and guys,
> >>
> >> This patchset fixes several issues(1, 2, 4) and consolidate & improve
> >> the tests in the following ways:
> >>
> >> - support shellcheck and fixes all warning
> >>
> >> - misc cleanup
> >>
> >> - improve cleanup code path(module load/unload, cleanup temp files)
> >>
> >> - help to reuse the same test source code and scripts for other
> >>   projects(liburing[1], blktest, ...)
> >>
> >> - add two stress tests for covering IO workloads vs. removing device &
> >> killing ublk server, given buffer lifetime is one big thing for ublk-zc
> >>
> >>
> >> [1] https://github.com/ming1/liburing/commits/ublk-zc
> >>
> >> - just need one line change for overriding skip_code, libring uses 77 and
> >>   kselftests takes 4
> > 
> > Hi Jens,
> > 
> > Can you merge this patchset if you are fine?
> 
> Yep sorry, was pondering how best to get it staged. Should go into
> block, but depends on the other bits that I staged for io_uring. So I'll
> just put it there, not a big deal.

Thanks for pulling it in!

BTW, the test behavior depends on block too, otherwise it may fail because
ublk zc actually depends on the fix of "ublk: complete command synchronously on error".

So if anyone wants to try the test, please do it against next tree.

Thanks,
Ming
Jens Axboe March 11, 2025, 1:28 p.m. UTC | #5
On 3/10/25 10:35 PM, Ming Lei wrote:
> On Mon, Mar 10, 2025 at 09:17:56AM -0600, Jens Axboe wrote:
>> On 3/10/25 9:09 AM, Ming Lei wrote:
>>> On Mon, Mar 3, 2025 at 8:43?PM Ming Lei <ming.lei@redhat.com> wrote:
>>>>
>>>> Hello Jens and guys,
>>>>
>>>> This patchset fixes several issues(1, 2, 4) and consolidate & improve
>>>> the tests in the following ways:
>>>>
>>>> - support shellcheck and fixes all warning
>>>>
>>>> - misc cleanup
>>>>
>>>> - improve cleanup code path(module load/unload, cleanup temp files)
>>>>
>>>> - help to reuse the same test source code and scripts for other
>>>>   projects(liburing[1], blktest, ...)
>>>>
>>>> - add two stress tests for covering IO workloads vs. removing device &
>>>> killing ublk server, given buffer lifetime is one big thing for ublk-zc
>>>>
>>>>
>>>> [1] https://github.com/ming1/liburing/commits/ublk-zc
>>>>
>>>> - just need one line change for overriding skip_code, libring uses 77 and
>>>>   kselftests takes 4
>>>
>>> Hi Jens,
>>>
>>> Can you merge this patchset if you are fine?
>>
>> Yep sorry, was pondering how best to get it staged. Should go into
>> block, but depends on the other bits that I staged for io_uring. So I'll
>> just put it there, not a big deal.
> 
> Thanks for pulling it in!
> 
> BTW, the test behavior depends on block too, otherwise it may fail
> because ublk zc actually depends on the fix of "ublk: complete command
> synchronously on error".
> 
> So if anyone wants to try the test, please do it against next tree.

Indeed - not a huge deal, as they will go into the main tree at roughly
the same time anyway. But good to note.