Re: [LTP] [PATCH v2 7/7] Add ioctl_ficlone04 test

Cyril Hrubis
2024-07-24T20:04:51Z

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