[LTP] [PATCH 1/2] tst_test: Add $LTP_SINGLE_ITERATION to limit variant
Li Wang
liwang@redhat.com
Mon Feb 24 11:11:07 CET 2025
Hi Petr, Andrea,
On Mon, Feb 24, 2025 at 6:00 PM Petr Vorel <pvorel@suse.cz> wrote:
> Allow to test only single struct tst_test->test_variants.
> This is a similar feature to $LTP_SINGLE_FS_TYPE.
>
> Value is ignored when test does not specify test_variants.
> When value is higher than test_variants value lastest variant is used.
>
> # LTP_SINGLE_VARIANT=0 LTP_SINGLE_FS_TYPE=ext4 ./getdents02
> ..
> tst_test.c:1918: TINFO: WARNING: testing only variant 0 of 3
> tst_supported_fs_types.c:161: TINFO: WARNING: testing only ext4
> tst_supported_fs_types.c:97: TINFO: Kernel supports ext4
> tst_supported_fs_types.c:62: TINFO: mkfs.ext4 does exist
> tst_test.c:1834: TINFO: === Testing on ext4 ===
> tst_test.c:1171: TINFO: Formatting /dev/loop0 with ext4 opts=''
> extra opts=''
> mke2fs 1.47.2 (1-Jan-2025)
> tst_test.c:1183: TINFO: Mounting /dev/loop0 to
> /tmp/LTP_getx2HrGH/mntpoint fstyp=ext4 flags=0
> getdents.h:148: TINFO: Testing the SYS_getdents syscall
> tst_buffers.c:57: TINFO: Test is using guarded buffers
> getdents02.c:77: TPASS: fd=-5 dirp=0x7f0587803ee9 size=279 : EBADF
> (9)
> getdents02.c:77: TPASS: fd=3 dirp=0x5641617a31e8 size=1 : EINVAL
> (22)
> getdents02.c:77: TPASS: fd=4 dirp=0x7f0587803ee9 size=279 :
> ENOTDIR (20)
> getdents02.c:77: TPASS: fd=5 dirp=0x7f0587803ee9 size=279 : ENOENT
> (2)
> getdents02.c:77: TPASS: fd=3 dirp=0x7f0587802000 size=279 : EFAULT
> (14)
>
> # LTP_SINGLE_VARIANT=2 LTP_SINGLE_FS_TYPE=ext4 ./getdents02
> ...
> tst_test.c:1918: TINFO: WARNING: testing only variant 2 of 3
> tst_supported_fs_types.c:161: TINFO: WARNING: testing only ext4
> tst_supported_fs_types.c:97: TINFO: Kernel supports ext4
> tst_supported_fs_types.c:62: TINFO: mkfs.ext4 does exist
> tst_test.c:1834: TINFO: === Testing on ext4 ===
> tst_test.c:1171: TINFO: Formatting /dev/loop0 with ext4 opts=''
> extra opts=''
> mke2fs 1.47.2 (1-Jan-2025)
> tst_test.c:1183: TINFO: Mounting /dev/loop0 to
> /tmp/LTP_getWtBnGE/mntpoint fstyp=ext4 flags=0
> getdents.h:157: TCONF: libc getdents() is not implemented
>
> # LTP_SINGLE_VARIANT=99 LTP_SINGLE_FS_TYPE=ext4 ./getdents02 #
> higher value is max value
> tst_test.c:1918: TINFO: WARNING: testing only variant 3 of 3
> tst_supported_fs_types.c:161: TINFO: WARNING: testing only ext4
> tst_supported_fs_types.c:97: TINFO: Kernel supports ext4
> tst_supported_fs_types.c:62: TINFO: mkfs.ext4 does exist
> tst_test.c:1834: TINFO: === Testing on ext4 ===
> tst_test.c:1171: TINFO: Formatting /dev/loop0 with ext4 opts=''
> extra opts=''
> mke2fs 1.47.2 (1-Jan-2025)
> tst_test.c:1183: TINFO: Mounting /dev/loop0 to
> /tmp/LTP_get1fX70n/mntpoint fstyp=ext4 flags=0
> getdents.h:162: TINFO: Testing libc getdents64()
> tst_buffers.c:57: TINFO: Test is using guarded buffers
> getdents02.c:77: TPASS: fd=-5 dirp=0x7fcf140f3ee8 size=280 : EBADF
> (9)
> getdents02.c:77: TPASS: fd=3 dirp=0x55a76e4531e8 size=1 : EINVAL
> (22)
> getdents02.c:77: TPASS: fd=4 dirp=0x7fcf140f3ee8 size=280 :
> ENOTDIR (20)
> getdents02.c:77: TPASS: fd=5 dirp=0x7fcf140f3ee8 size=280 : ENOENT
> (2)
> getdents02.c:77: TPASS: fd=3 dirp=0x7fcf140f2000 size=280 : EFAULT
> (14)
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Hi all,
>
> Andrea wanted to run only single variant.
>
Could you tell me what the benefit is? why do we need this?
And back to the patch itself, if LTP_SINGLE_ITERATION is used, which
variant will be chosen to run by default? Is that expected?
--
Regards,
Li Wang
More information about the ltp
mailing list