From: Wei Gao via ltp <ltp@lists.linux.it>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/1] ns_ifmove.c: Rewrite to new API
Date: Wed, 15 Mar 2023 00:38:57 -0400 [thread overview]
Message-ID: <20230315043857.GA5336@localhost> (raw)
In-Reply-To: <20230315020140.GA138022@pevik>
On Wed, Mar 15, 2023 at 03:01:40AM +0100, Petr Vorel wrote:
> > On Thu, Mar 09, 2023 at 03:59:17PM +0100, Petr Vorel wrote:
> > > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > > ---
> > > testcases/kernel/containers/share/ns_ifmove.c | 98 ++++++-------------
> > > 1 file changed, 28 insertions(+), 70 deletions(-)
>
> > > int intf_index, pid, rtnetlink_socket;
>
> > > if (argc != 3) {
> > > - tst_resm(TINFO, "%s <INTERFACE_NAME> <NAMESPACE_PID>",
> > > - argv[0]);
> > > + printf("ns_ifmove <INTERFACE_NAME> <NAMESPACE_PID>\n");
> > > return 1;
> > > }
>
> > should we use tst_res(TINFO) instead of printf?
>
> NO. If you look into testcases/lib/, none of *.c tools use tst_res().
> The only separation between API for tests and API for tools / library
> than TST_NO_DEFAULT_MAIN.
Got it, this is lib API. Why ns_ifmove.c's parent directory name is
"share" instead of "lib" or at least contain "lib" key word?
>
> Actually, unless SAFE_*() are useful to use (here SAFE_SOCKET() and
> SAFE_IOCTL()), we prefer to not use tst_test.h at all (see tst_cgctl.c,
> tst_device.c, ...)
>
> I also think that tst_get_free_pids.c does not need TST_NO_DEFAULT_MAIN and
> tst_test workarounds.
Is there possible split current tst_test.h to two files and remove
TST_NO_DEFAULT_MAIN workaround? Such as tst_tools.h(include SAFE*) for lib api
and main.h for testcase.
>
> Kind regards,
> Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2023-03-15 4:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-09 14:59 [LTP] [PATCH 1/1] ns_ifmove.c: Rewrite to new API Petr Vorel
2023-03-09 14:59 ` Andrea Cervesato via ltp
2023-03-10 2:54 ` Bird, Tim
2023-03-10 7:34 ` Petr Vorel
2023-03-10 11:47 ` Petr Vorel
2023-03-10 18:11 ` Bird, Tim
2023-03-13 20:53 ` Petr Vorel
2023-03-23 15:59 ` Petr Vorel
2023-03-15 0:56 ` Wei Gao via ltp
2023-03-15 2:01 ` Petr Vorel
2023-03-15 4:38 ` Wei Gao via ltp [this message]
2023-03-15 10:35 ` Petr Vorel
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=20230315043857.GA5336@localhost \
--to=ltp@lists.linux.it \
--cc=pvorel@suse.cz \
--cc=wegao@suse.com \
/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