[LTP] [PATCH v3 4/5] tst_test.sh: Cleanup getopts usage

Petr Vorel pvorel@suse.cz
Tue May 10 07:23:29 CEST 2022


> Hi!
> > >> +. netns_helper.sh
> > >> +
> > >> +PROG=$1
> > >> +IP_VER=$2
> > >> +COM_TYPE=$3

> > > Can't we just keep these at the top along with the rest of the
> > > variables? I do not see them redefined anywhere but maybe I miss
> > > something.

> > tst_test.sh has to process command line arguments before these variables
> > can be set. Otherwise you'd have to put all command line switches
> > *AFTER* the positional arguments.

> I did sleep on this and I guess that the cleanest solution for this is
> to pass the positional arguments to the test setup function instead.
> What do you think?

Sure. That's what I already did in "[v2,3/3] netns: Rewrite to use tst_net.sh"
[1]. That's why I didn't care in this patchset. I plan to send rebased "shell:
Fixes for disabled IPv6" patchset today or tomorrow.

Kind regards,
Petr

[1] https://patchwork.ozlabs.org/project/ltp/patch/20220204194648.32165-4-pvorel@suse.cz/


More information about the ltp mailing list