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: <ZXzhsiSX2bPlEkL9@d3>
Date: Fri, 15 Dec 2023 18:30:58 -0500
From: Benjamin Poirier <benjamin.poirier@...il.com>
To: Hangbin Liu <liuhangbin@...il.com>
Cc: Patrice Duroux <patrice.duroux@...il.com>,
	Vladimir Oltean <vladimir.oltean@....com>,
	Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
	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 2023-12-15 10:35 +0800, Hangbin Liu wrote:
> On Thu, Dec 14, 2023 at 05:00:31PM -0500, Benjamin Poirier wrote:
> > I started to make the adjustments to all the tests but I got stuck on
> > the dsa tests. The problem is that the tests which are symlinked (like
> > bridge_locked_port.sh) expect to source lib.sh (net/forwarding/lib.sh)
> > from the same directory. That lib.sh then expects to source net/lib.sh
> > from the parent directory. Because `rsync --copy-unsafe-links` is used,
> > all those links become regular files after export so we can't rely on
> > `readlink -f`.
> > 
> > Honestly, given how the dsa tests are organized, I don't see a clean way
> > to support these tests without error after commit 25ae948b4478
> > ("selftests/net: add lib.sh").
> 
> No worry, the last way is just make net/forwarding/lib.sh not source net/lib.sh :)
> Although this would make us copy a lot functions from net/forwarding/lib.sh to
> source net/lib.sh. So before that, let's try if we can
> 
> Move all the dsa tests back to net/forwarding (actually only needed for
> test_bridge_fdb_stress.sh). And add a forwarding.config.dsa.sample. Maybe
> a test list for dsa testing. But with this way the dsa testing will not
> able to run via run_kselftest.sh.
> 
> Or, we can remove the symlinks, and add the dsa tests with exec the relative
> forwarding path's tests directly. e.g.
> 
> ### in das test folder
> 
> $ cat bridge_mld.sh
> #!/bin/bash
> ../../../net/forwarding/bridge_mld.sh
> 
> $ cat Makefile
> # SPDX-License-Identifier: GPL-2.0+ OR MIT
> 
> TEST_PROGS = \
>         bridge_mld.sh
> 
> TEST_SH_LIBS := \
>         net/lib.sh \
>         net/forwarding/lib.sh \
>         net/forwarding/bridge_mld.sh
> 
> TEST_FILES := forwarding.config
> 
> include ../../../lib.mk
> 
> ### for net/forwarding/lib.sh looks we need source the ${PWD}/forwarding.config if run via run_kselftest.sh
> 
> if [[ -f ${PWD}/forwarding.config ]]; then
>         source "$PWD/forwarding.config"
> elif [[ -f $relative_path/forwarding.config ]]; then
>         source "$relative_path/forwarding.config"
> fi
> 
> What do you think?

That's a good idea. Thank you for your suggestion. I made a few
adjustment from what you show and the result seems to work so far.

I'm working on the full patchset. If there is no problem, I'll post it
next week.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ