lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZXlIew7PbTglpUmV@Laptop-X1>
Date: Wed, 13 Dec 2023 14:00:27 +0800
From: Hangbin Liu <liuhangbin@...il.com>
To: Benjamin Poirier <benjamin.poirier@...il.com>
Cc: Petr Machata <petrm@...dia.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	netdev@...r.kernel.org, Shuah Khan <shuah@...nel.org>,
	mlxsw@...dia.com, Jay Vosburgh <j.vosburgh@...il.com>
Subject: Re: [PATCH net-next] selftests: forwarding: Import top-level lib.sh
 through $lib_dir

On Tue, Dec 12, 2023 at 03:17:01PM -0500, Benjamin Poirier wrote:
> On 2023-12-12 18:22 +0100, Petr Machata wrote:
> > 
> > Hangbin Liu <liuhangbin@...il.com> writes:
> > 
> > > On Mon, Dec 11, 2023 at 01:01:06PM +0100, Petr Machata wrote:
> > >
> > >> @@ -38,7 +38,7 @@ if [[ -f $relative_path/forwarding.config ]]; then
> > >>  	source "$relative_path/forwarding.config"
> > >>  fi
> > >>  
> > >> -source ../lib.sh
> > >> +source ${lib_dir-.}/../lib.sh
> > >>  ##############################################################################
> > >>  # Sanity checks
> > >
> > > Hi Petr,
> > >
> > > Thanks for the report. However, this doesn't fix the soft link scenario. e.g.
> > > The bonding tests tools/testing/selftests/drivers/net/bonding add a soft link
> > > net_forwarding_lib.sh and source it directly in dev_addr_lists.sh.
> > 
> > I see, I didn't realize those exist.
> > 
> > > So how about something like:
> > >
> > > diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
> > > index 8f6ca458af9a..7f90248e05d6 100755
> > > --- a/tools/testing/selftests/net/forwarding/lib.sh
> > > +++ b/tools/testing/selftests/net/forwarding/lib.sh
> > > @@ -38,7 +38,8 @@ if [[ -f $relative_path/forwarding.config ]]; then
> > >         source "$relative_path/forwarding.config"
> > >  fi
> > >
> > > -source ../lib.sh
> > > +forwarding_dir=$(dirname $(readlink -f $BASH_SOURCE))
> > > +source ${forwarding_dir}/../lib.sh
> > 
> > Yep, that's gonna work.
> > I'll pass through our tests and send later this week.
> > 
> 
> There is also another related issue which is that generating a test
> archive using gen_tar for the tests under drivers/net/bonding does not
> include the new lib.sh. This is similar to the issue reported here:
> https://lore.kernel.org/netdev/40f04ded-0c86-8669-24b1-9a313ca21076@redhat.com/
> 
> /tmp/x# ./run_kselftest.sh
> TAP version 13
> [...]
> # timeout set to 120
> # selftests: drivers/net/bonding: dev_addr_lists.sh
> # ./net_forwarding_lib.sh: line 41: ../lib.sh: No such file or directory
> # TEST: bonding cleanup mode active-backup                            [ OK ]
> # TEST: bonding cleanup mode 802.3ad                                  [ OK ]
> # TEST: bonding LACPDU multicast address to slave (from bond down)    [ OK ]
> # TEST: bonding LACPDU multicast address to slave (from bond up)      [ OK ]
> ok 4 selftests: drivers/net/bonding: dev_addr_lists.sh
> [...]

Hmm.. Is it possible to write a rule in the Makefile to create the net/
and net/forwarding folder so we can source the relative path directly. e.g.

]# tree
.
├── drivers
│   └── net
│       └── bonding
│           ├── bond-arp-interval-causes-panic.sh
│           ├── ...
│           └── settings
├── kselftest
│   ├── module.sh
│   ├── prefix.pl
│   └── runner.sh
├── kselftest-list.txt
├── net
│   ├── forwarding
│   │   └── lib.sh
│   └── lib.sh
└── run_kselftest.sh

Thanks
Hangbin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ