[LTP] [PATCH v2 7/7] Add ioctl_ficlone04 test
Cyril Hrubis
chrubis@suse.cz
Wed Jul 24 22:06:57 CEST 2024
Hi!
> I can't understand what's the best way to test all the combinations. As
> you can see there are many flags, which means the amount of permutations
> is big.
> Most of those flags are handled (indeed) in the wrong way, since most of
> their permutations return EXDEV. The point is that the syscall has many
> error codes, so it's complex to write a code that covers all possible
> results.
>
> My idea would be to have an array of errors to give to
> TST_EXP_FAIL2_ARR() and to avoid any statement around fd_src/fd_dst,
> because the amount of if/switch-case might explode with the number of
> permutations.
The purpose of the tst_fd iterator is mainly to hammer syscalls with
different kinds of file descriptors and trigger code paths in the kernel
that are not excercies under normal circumstances. So it's fine to have
a single array with a few sensible errno codes and pass that in all the
cases.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list