[PATCH blktests 01/11] check: factor out _run_test()
Shinichiro Kawasaki
shinichiro.kawasaki at wdc.com
Fri Apr 12 03:59:05 PDT 2024
On Apr 11, 2024 / 19:04, Nitesh Shetty wrote:
> On 11/04/24 08:12PM, Shin'ichiro Kawasaki wrote:
> > The function _run_test() is rather complex and has deep nests. Before
> > modifying it for repeated test case runs, simplify it. Factor out some
> > part of the function to the new functions _check_and_call_test() and
> > _check_and_call_test_device().
> >
> > Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki at wdc.com>
> > ---
> > check | 90 +++++++++++++++++++++++++++++++++++------------------------
> > 1 file changed, 53 insertions(+), 37 deletions(-)
> >
> > diff --git a/check b/check
> > index 55871b0..b1f5212 100755
> > --- a/check
> > +++ b/check
> > @@ -463,6 +463,56 @@ _unload_modules() {
> > unset MODULES_TO_UNLOAD
> > }
> >
> > +_check_and_call_test() {
>
> ret should be declared ret as local ?
Yes, will do so in v2.
>
> > + if declare -fF requires >/dev/null; then
> > + requires
> > + fi
> > +
> > + RESULTS_DIR="$OUTPUT/nodev"
> > + _call_test test
> > + ret=$?
> > + if (( RUN_ZONED_TESTS && CAN_BE_ZONED )); then
> > + RESULTS_DIR="$OUTPUT/nodev_zoned"
> > + RUN_FOR_ZONED=1
> > + _call_test test
> > + ret=$(( ret || $? ))
> > + fi
> > +
> > + return $ret
> > +}
> > +
> > +_check_and_call_test_device() {
> > + local unset_skip_reason
>
> Same here, ret should declared be local ?
Yes, and thanks for the review :)
>
> Reviewed-by: Nitesh Shetty <nj.shetty at samsung.com>
More information about the Linux-nvme
mailing list