[LTP] [PATCH v2] commands/mkswap01.sh: Fix unexisted "/dev/disk/by-*" files on old kernels

Li Wang liwang@redhat.com
Mon Jun 25 11:02:31 CEST 2018


On Sun, Jun 24, 2018 at 1:59 PM, Xiao Yang <yangx.jy@cn.fujitsu.com> wrote:
> Before kernel commit c3473c6(e.g. RHEL6), mkswap -L or mkswap -U for loop
> devices can not generate corresponding "/dev/disk/by-*" files.  It is just
> a way to check the success of mkswap rather than a bug, so the test should
> not get TBROK when "/dev/disk/by-*" files are not generated but swapon
> enables loop devices for swapping sucessfully.
>
> Suggested-by: Li Wang <liwang@redhat.com>
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Li Wang <liwang@redhat.com>

> ---
>  testcases/commands/mkswap/mkswap01.sh | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/testcases/commands/mkswap/mkswap01.sh b/testcases/commands/mkswap/mkswap01.sh
> index 5ead4cd..4185702 100755
> --- a/testcases/commands/mkswap/mkswap01.sh
> +++ b/testcases/commands/mkswap/mkswap01.sh
> @@ -64,7 +64,12 @@ mkswap_verify()
>                 local pagesize=$PAGE_SIZE
>         fi
>
> -       TST_RETRY_FUNC "check_for_file $dev_file" 0
> +       if tst_kvcmp -lt "2.6.35" && [ -n "$dev_file" ]; then
> +               tst_res TINFO "Waiting for $dev_file to appear"
> +               tst_sleep 100ms
> +       else
> +               TST_RETRY_FUNC "check_for_file $dev_file" 0
> +       fi
>
>         swapon $swapfile 2>/dev/null
>
> --
> 1.8.3.1
>
>
>



-- 
Regards,
Li Wang


More information about the ltp mailing list