[LTP] [PATCH 2/2] mkswap01: wait for the triggered events to complete

Li Wang liwang@redhat.com
Thu Apr 21 08:44:11 CEST 2022


On Thu, Apr 21, 2022 at 10:18 AM Li Wang <liwang@redhat.com> wrote:

>
>
> On Thu, Apr 21, 2022 at 4:56 AM Petr Vorel <pvorel@suse.cz> wrote:
>
>
>>
>> > -     udevadm trigger --name-match=$TST_DEVICE
>> > +     udevadm trigger --name-match=$TST_DEVICE --settle
>>
>> >       if [ -n "$device" ]; then
>> >               mkswap_verify "$mkswap_op" "$op_arg" "$device" "$size"
>> "$dev_file"
>>
>> --settle option for udevadm trigger has been added in v238 (in 2018) [1].
>> This mean on SLES 12-SP5, RHEL-7.9, 18.04 LTS bionic, ... we get:
>>
>> trigger: unrecognized option '--settle'
>>
>
> Thanks for pointing out this, Petr.
>
>>
>> Do we ignore backward compatibility hoping that all distros aren't tested
>> with
>> newer LTP?
>>
>
> Actually, we only use fixed older-version of LTP for long-term supported
> distros (e.g RHEL6/7) testing, as it falls into maintaining phase and no
> new
> features are added in. So this won't be a problem for us.
>
> But if we consider fully backward compatibility of newer LTP for old
> distros,
> this is a burden to maintaining work. We might need to make a balance on
> the patch accept or reject.
>
> With regard to this simple patch, if you think it's a problem to SLES
> 12-SP5, I'm
> fine to NAK and rewrite with another way (at least for ioctl09 I will do
> that).
>
> But if you're OK with making use of fixed LTP on older distros, feel free
> to apply this one :).
>


Or, just go with the traditional way for compatibility:

--- a/testcases/commands/mkswap/mkswap01.sh
+++ b/testcases/commands/mkswap/mkswap01.sh
@@ -128,7 +128,8 @@ mkswap_test()
                return
        fi

-       udevadm trigger --name-match=$TST_DEVICE --settle
+       udevadm trigger --name-match=$TST_DEVICE
+       udevadm settle --exit-if-exists==$TST_DEVICE

        if [ -n "$device" ]; then
                mkswap_verify "$mkswap_op" "$op_arg" "$device" "$size"
"$dev_file"


-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20220421/490bcfac/attachment-0001.htm>


More information about the ltp mailing list