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]
Date: Fri, 15 Dec 2023 10:35:32 +0800
From: Hangbin Liu <liuhangbin@...il.com>
To: Benjamin Poirier <benjamin.poirier@...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 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?

Thanks
Hangbin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ