[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231227192758.iq3s4mirkf2dm5mj@skbuf>
Date: Wed, 27 Dec 2023 21:27:58 +0200
From: Vladimir Oltean <vladimir.oltean@....com>
To: Benjamin Poirier <bpoirier@...dia.com>
Cc: netdev@...r.kernel.org, Shuah Khan <shuah@...nel.org>,
Petr Machata <petrm@...dia.com>, Hangbin Liu <liuhangbin@...il.com>
Subject: Re: [RFC PATCH net-next 04/10] selftests: forwarding: Simplify
forwarding.config import logic
On Fri, Dec 22, 2023 at 08:58:30AM -0500, Benjamin Poirier wrote:
> The first condition removed by this patch reimplements functionality that
> is part of `dirname`:
> $ dirname ""
> .
>
> Use the libdir variable introduced in the previous patch to import
> forwarding.config without duplicating functionality.
>
> Signed-off-by: Benjamin Poirier <bpoirier@...dia.com>
> ---
> tools/testing/selftests/net/forwarding/lib.sh | 14 +++++---------
> 1 file changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
> index f9e32152f23d..481d9b655a40 100644
> --- a/tools/testing/selftests/net/forwarding/lib.sh
> +++ b/tools/testing/selftests/net/forwarding/lib.sh
> @@ -29,16 +29,12 @@ STABLE_MAC_ADDRS=${STABLE_MAC_ADDRS:=no}
> TCPDUMP_EXTRA_FLAGS=${TCPDUMP_EXTRA_FLAGS:=}
> TROUTE6=${TROUTE6:=traceroute6}
>
> -relative_path="${BASH_SOURCE%/*}"
> -if [[ "$relative_path" == "${BASH_SOURCE}" ]]; then
> - relative_path="."
> -fi
> -
> -if [[ -f $relative_path/forwarding.config ]]; then
> - source "$relative_path/forwarding.config"
> -fi
> -
> libdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
> +
> +if [ -f "$libdir"/forwarding.config ]; then
> + source "$libdir"/forwarding.config
Nitpick: this used to be indented with tabs, not spaces. Also, any
reason why only "$libdir" is quoted and not the full path, as before?
Otherwise:
Reviewed-by: Vladimir Oltean <vladimir.oltean@....com>
> +fi
> +
> source "$libdir"/../lib.sh
>
> ##############################################################################
> --
> 2.43.0
>
Powered by blists - more mailing lists