Skip to content
Commit 9f2af915 authored by Benjamin Poirier's avatar Benjamin Poirier Committed by David S. Miller
Browse files

selftests: forwarding: Redefine relative_path variable



The following code which is part of lib.sh:
relative_path="${BASH_SOURCE%/*}"
if [[ "$relative_path" == "${BASH_SOURCE}" ]]; then
       relative_path="."
fi

reimplements functionality that is part of `dirname`:
$ dirname ""
.

To avoid this duplication, replace "relative_path" by "net_forwarding_dir",
a new variable defined using dirname.

Furthermore, to avoid the potential confusion about what "relative_path" is
about (cwd, test script directory or test library directory), define
"net_forwarding_dir" as the absolute path to net/forwarding/.

Tested-by: default avatarPetr Machata <petrm@nvidia.com>
Reviewed-by: default avatarHangbin Liu <liuhangbin@gmail.com>
Signed-off-by: default avatarBenjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4a24560a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment