Netdev List
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	 Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: Paolo Abeni <pabeni@redhat.com>,
	 netdev@vger.kernel.org,  davem@davemloft.net,
	 edumazet@google.com,  ncardwell@google.com,  shuah@kernel.org,
	 linux-kselftest@vger.kernel.org,  fw@strlen.de,
	 Willem de Bruijn <willemb@google.com>,
	 "Matthieu Baerts (NGI0)" <matttbe@kernel.org>,
	 martineau@kernel.org
Subject: Re: [PATCH net-next RFC] selftests/net: integrate packetdrill with ksft
Date: Fri, 30 Aug 2024 17:46:16 -0400	[thread overview]
Message-ID: <66d23da8e7cb7_3d822329461@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <66d213cf6652e_3c8f2d294b8@willemb.c.googlers.com.notmuch>

Willem de Bruijn wrote:
> Jakub Kicinski wrote:
> > On Fri, 30 Aug 2024 11:20:05 -0400 Willem de Bruijn wrote:
> > > Kselftest install does not preserve directories.
> > > 
> > > So all .pkt files are copied into net/packetdrill root. This is messy.
> > > More fundamentally it breaks the includes in the files (e..g, `source
> > > ../common/defaults.sh`).
> > 
> > Can you show an example of exact commands and what happens?
> 
> Running directly works fine:
> 
>     $ KSELFTEST_PKT_INTERP=packetdrill_ksft.sh
>     $ make -C tools/testing/selftests \
>             TARGETS=net/packetdrill O=/tmp run_tests
> 
>     TAP version 13
>     1..3
>     # timeout set to 45
>     # selftests: net/packetdrill: client.pkt
>     # TAP version 13
>     # 1..2
>     # ok 1 ipv4
>     # ok 2 ipv6
>     # # Totals: pass:2 fail:0 xfail:0 xpass:0 skip:0 error:0
>     ok 1 selftests: net/packetdrill: client.pkt
>     [..etc..]
> 
> Installing does not:
> 
>     $ make -C tools/testing/selftests/ \
>           TARGETS=net/packetdrill \
>           install INSTALL_PATH=$INSTALL_DIR
>     $ cd $INSTALL_DIR
>     $ export KSELFTEST_PKT_INTERP=packetdrill_ksft.sh
>     $ ./run_kselftest.sh -c net/packetdrill
> 
>     TAP version 13
>     1..3
>     # timeout set to 45
>     # selftests: net/packetdrill: client.pkt
>     # TAP version 13
>     # 1..2
>     # sh: line 1: ../common/defaults.sh: No such file or directory
>     # ./client.pkt: error executing init command: non-zero status 127
>     # not ok 1 ipv4
>     # sh: line 1: ../common/defaults.sh: No such file or directory
>     # ./client.pkt: error executing init command: non-zero status 127
>     # not ok 2 ipv6
>     # # Totals: pass:0 fail:2 xfail:0 xpass:0 skip:0 error:0
>     not ok 1 selftests: net/packetdrill: client.pkt # exit=1
> 
> Due to that relative path to defaults.sh inside the scripts.
> 
> It is arguably a bit weird that the relative path of the TEST_PROGS
> differs before and after install.

I guess what's weird is more what I'm trying to do. There has been
no need so far for progs in subdirectories from the TARGET.

One option is to just create a bunch of targets with a wildcard.
Something like below (entirely untested).

TARGETS += net/packetdrill/tcp/$(wildcard *)

> > We have directories in net/lib, and it's a target, and it works, no?
> 
> net/lib is not a TARGET in tools/testing/selftests/Makefile. Its
> Makefile only generates dependencies for other targets: TEST_FILES,
> TEST_GEN_FILES and TEST_INCLUDES.
> 
> This issue with preserving paths until recently also existed for
> helper files (TEST_FILES). TEST_INCLUDES was added expressly to
> preserve those paths (commit 2a0683be5b4c).

Another option is to dive yet deeper into kselftest infra and do the
same for TEST_PROGS, either TEST_PROGS itself or as a new
TEST_PROGS_FULLPATH or so.

It needs a change to INSTALL_RULE (maybe just passing -R to rsync),
to emit_tests to skip basename when writing kselftest-list.txt, and
probably to run_one() to break up the path and chdir. I'll see if I
can make this work without too much churn.

  parent reply	other threads:[~2024-08-30 21:46 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27 19:32 [PATCH net-next RFC] selftests/net: integrate packetdrill with ksft Willem de Bruijn
2024-08-28  0:39 ` Jakub Kicinski
2024-08-28 13:58   ` Willem de Bruijn
2024-08-28  8:20 ` Paolo Abeni
2024-08-28 14:03   ` Willem de Bruijn
2024-08-28 16:01     ` Jakub Kicinski
2024-08-28 19:33       ` Willem de Bruijn
2024-08-28 21:00         ` Jakub Kicinski
2024-08-30 15:20           ` Willem de Bruijn
2024-08-30 17:33             ` Jakub Kicinski
2024-08-30 18:47               ` Willem de Bruijn
2024-08-30 21:44                 ` Jakub Kicinski
2024-08-30 21:52                   ` Willem de Bruijn
2024-09-01 21:15                     ` Willem de Bruijn
2024-09-02 16:46                       ` Jakub Kicinski
2024-09-02 16:56                         ` Jakub Kicinski
2024-09-02 20:50                           ` Willem de Bruijn
2024-09-05  3:27                   ` Willem de Bruijn
2024-08-30 21:46                 ` Willem de Bruijn [this message]
2024-08-28 16:26     ` Matthieu Baerts
2024-08-28 15:01 ` Stanislav Fomichev
2024-08-28 15:36   ` Jakub Kicinski
2024-08-28 15:43   ` Willem de Bruijn
2024-08-28 17:20     ` Stanislav Fomichev
2024-08-28 18:23       ` Jakub Kicinski
2024-08-28 18:36         ` Stanislav Fomichev
2024-08-28 18:26 ` Mina Almasry
2024-08-28 18:39   ` Jakub Kicinski

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=66d23da8e7cb7_3d822329461@willemb.c.googlers.com.notmuch \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martineau@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --cc=willemb@google.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