public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Martin Doucha <mdoucha@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2 1/4] shell: Use conditional expansion for library setup/cleanup
Date: Wed, 27 Apr 2022 11:00:47 +0200	[thread overview]
Message-ID: <YmkGP5aJcpiQXuK8@pevik> (raw)
In-Reply-To: <d448fbda-cbfb-e954-f5de-f1aa02b5bfd0@suse.cz>

Hi Martin,

> > diff --git a/testcases/network/busy_poll/busy_poll_lib.sh b/testcases/network/busy_poll/busy_poll_lib.sh
...
> > -TST_SETUP="setup"
> >  TST_TESTFUNC="test"
> > -TST_CLEANUP="cleanup"
> > +TST_SETUP="${TST_SETUP:-setup}"
> > +TST_CLEANUP="${TST_CLEANUP:-cleanup}"

> The setup() and cleanup() functions here should get a prefix, otherwise
> we're asking for duplicate definitions. But that can be added in a
> separate patchset.

Actually setup() and cleanup() are functions in the test, thus the name is correct,
This was written by Alexey, but I also had this approach to put the same
variables into library. Test defines many variables, thus I'd keep them in the
library:

TST_TESTFUNC="test"
TST_SETUP="${TST_SETUP:-setup}"
TST_CLEANUP="${TST_CLEANUP:-cleanup}"
TST_MIN_KVER="3.11"
TST_NEEDS_TMPDIR=1
TST_NEEDS_ROOT=1
TST_NEEDS_CMDS="pkill sysctl ethtool"
# for more stable results set to a single thread
TST_NETLOAD_CLN_NUMBER=1

But I'd suggest to change:

# setup and cleanup defined in the test
TST_SETUP="setup"
TST_CLEANUP="cleanup"

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  parent reply	other threads:[~2022-04-27  9:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22 14:41 [LTP] [PATCH v2 0/4] shell: Cleanup getopts usage Petr Vorel
2022-04-22 14:41 ` [LTP] [PATCH v2 1/4] shell: Use conditional expansion for library setup/cleanup Petr Vorel
2022-04-26 10:53   ` Martin Doucha
2022-04-27  8:02     ` Petr Vorel
2022-04-27  9:00     ` Petr Vorel [this message]
2022-04-22 14:41 ` [LTP] [PATCH v2 2/4] doc: Update library API doc Petr Vorel
2022-04-26 11:03   ` Martin Doucha
2022-04-27  8:04     ` Petr Vorel
2022-04-22 14:41 ` [LTP] [PATCH v2 3/4] tst_test.sh: Cleanup getopts usage Petr Vorel
2022-04-26 14:24   ` Martin Doucha
2022-04-27  8:10     ` Petr Vorel
2022-04-22 14:41 ` [LTP] [PATCH v2 4/4] doc: Update shell API examples Petr Vorel
2022-04-26 14:48   ` Martin Doucha
2022-04-25  3:35 ` [LTP] [PATCH v2 0/4] shell: Cleanup getopts usage Li Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YmkGP5aJcpiQXuK8@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=mdoucha@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox