All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@mellanox.com>
To: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	mlxsw <mlxsw@mellanox.com>, Petr Machata <petrm@mellanox.com>,
	Ido Schimmel <idosch@mellanox.com>
Subject: [PATCH net-next 4/9] selftests: forwarding: devlink_lib: Avoid double sourcing of lib.sh
Date: Thu, 28 Mar 2019 12:12:23 +0000	[thread overview]
Message-ID: <20190328121144.22911-5-idosch@mellanox.com> (raw)
In-Reply-To: <20190328121144.22911-1-idosch@mellanox.com>

From: Petr Machata <petrm@mellanox.com>

Don't source lib.sh twice and make the script work with ifnames passed
on the command line.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
---
 .../drivers/net/mlxsw/spectrum-2/tc_flower.sh          |  1 +
 .../drivers/net/mlxsw/spectrum/devlink_resources.sh    |  3 +++
 .../drivers/net/mlxsw/spectrum/resource_scale.sh       |  5 ++++-
 tools/testing/selftests/net/forwarding/devlink_lib.sh  | 10 ----------
 4 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower.sh b/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower.sh
index a372b2f60874..fb850e0ec837 100755
--- a/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower.sh
@@ -12,6 +12,7 @@ ALL_TESTS="single_mask_test identical_filters_test two_masks_test \
 	delta_two_masks_one_key_test delta_simple_rehash_test \
 	bloom_simple_test bloom_complex_test bloom_delta_test"
 NUM_NETIFS=2
+source $lib_dir/lib.sh
 source $lib_dir/tc_common.sh
 source $lib_dir/devlink_lib.sh
 
diff --git a/tools/testing/selftests/drivers/net/mlxsw/spectrum/devlink_resources.sh b/tools/testing/selftests/drivers/net/mlxsw/spectrum/devlink_resources.sh
index b1fe960e398a..6f2683cbc7d5 100755
--- a/tools/testing/selftests/drivers/net/mlxsw/spectrum/devlink_resources.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/spectrum/devlink_resources.sh
@@ -1,7 +1,10 @@
 #!/bin/bash
 # SPDX-License-Identifier: GPL-2.0
 
+lib_dir=$(dirname $0)/../../../../net/forwarding
+
 NUM_NETIFS=1
+source $lib_dir/lib.sh
 source devlink_lib_spectrum.sh
 
 setup_prepare()
diff --git a/tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh b/tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh
index e7ffc79561b7..43ba1b438f6d 100755
--- a/tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh
@@ -1,8 +1,11 @@
 #!/bin/bash
 # SPDX-License-Identifier: GPL-2.0
 
+lib_dir=$(dirname $0)/../../../../net/forwarding
+
 NUM_NETIFS=6
-source ../../../../net/forwarding/tc_common.sh
+source $lib_dir/lib.sh
+source $lib_dir/tc_common.sh
 source devlink_lib_spectrum.sh
 
 current_test=""
diff --git a/tools/testing/selftests/net/forwarding/devlink_lib.sh b/tools/testing/selftests/net/forwarding/devlink_lib.sh
index 57cf8914910d..981b897d418d 100644
--- a/tools/testing/selftests/net/forwarding/devlink_lib.sh
+++ b/tools/testing/selftests/net/forwarding/devlink_lib.sh
@@ -1,16 +1,6 @@
 #!/bin/bash
 # SPDX-License-Identifier: GPL-2.0
 
-##############################################################################
-# Source library
-
-relative_path="${BASH_SOURCE%/*}"
-if [[ "$relative_path" == "${BASH_SOURCE}" ]]; then
-	relative_path="."
-fi
-
-source "$relative_path/lib.sh"
-
 ##############################################################################
 # Defines
 
-- 
2.20.1


  parent reply	other threads:[~2019-03-28 12:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28 12:12 [PATCH net-next 0/9] selftests: forwarding: Add new test cases Ido Schimmel
2019-03-28 12:12 ` [PATCH net-next 1/9] selftests: forwarding: Add reverse path forwarding (RPF) " Ido Schimmel
2019-03-28 12:12 ` [PATCH net-next 2/9] selftests: forwarding: Add PCP match and VLAN match tests Ido Schimmel
2019-03-28 12:12 ` [PATCH net-next 3/9] selftests: forwarding: Test action VLAN modify Ido Schimmel
2019-03-28 12:12 ` [PATCH net-next 5/9] selftests: forwarding: devlink_lib: Simplify deduction of DEVLINK_DEV Ido Schimmel
2019-03-28 12:12 ` Ido Schimmel [this message]
2019-03-28 12:12 ` [PATCH net-next 6/9] selftests: forwarding: devlink_lib: Add shared buffer helpers Ido Schimmel
2019-03-28 12:12 ` [PATCH net-next 7/9] selftests: mlxsw: qos_mc_aware: Configure shared buffers Ido Schimmel
2019-03-28 12:12 ` [PATCH net-next 8/9] selftests: mlxsw: Add qos_lib.sh Ido Schimmel
2019-03-28 12:12 ` [PATCH net-next 9/9] selftests: mlxsw: Add a new test for strict priority Ido Schimmel
2019-03-29  0:21 ` [PATCH net-next 0/9] selftests: forwarding: Add new test cases David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190328121144.22911-5-idosch@mellanox.com \
    --to=idosch@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.