[PATCH blktests v4 05/17] common/rc: introduce _set_combined_conditions
Daniel Wagner
dwagner at suse.de
Mon May 6 07:48:46 PDT 2024
On Sat, May 04, 2024 at 05:14:36PM GMT, Shin'ichiro Kawasaki wrote:
> When the test case has the "set_conditions" hook, blktests repeats the
> test case multiple times. This allows repeating the test changing one
> condition parameter. However, it is often desired to run the test for
> multiple condition parameters. For example, some test cases in the nvme
> test group are required to run for different "transport types" as well
> as different "backend block device types". In this case, it is required
> to iterate over all combinations of the two condition parameters
> "transport types" and "backend block device types".
>
> To cover such iteration for the multiple condition parameters, introduce
> the helper function _set_combined_conditions. It takes multiple
> _set_conditions hooks as its arguments, combines them and works as the
> set_conditions() hook. When the hook x iterates x1 and x2, and the other
> hook y iterates y1 and y2, the function iterates (x1, y1), (x2, y1),
> (x1, y2) and (x2, y2). In other words, it iterates over the Cartesian
> product of the given condition sets.
>
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki at wdc.com>
I learned a bit on bash variable expansion today :)
Looks good.
Reviewed-by: Daniel Wagner <dwagner at suse.de>
More information about the Linux-nvme
mailing list