From: Danielle Ratson Date: Thu, 17 Oct 2019 06:55:15 +0000 (+0300) Subject: selftests: mlxsw: Generalize the parameters of mirror_gre test X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=49c65e4ff19772847e030e04121bece0517eb32c;p=openwrt%2Fstaging%2Fblogic.git selftests: mlxsw: Generalize the parameters of mirror_gre test Use the number of analyzers taken from the devlink command, instead of hard-coded value, in order to make the test more generic. Signed-off-by: Danielle Ratson Acked-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller --- diff --git a/tools/testing/selftests/drivers/net/mlxsw/spectrum/mirror_gre_scale.sh b/tools/testing/selftests/drivers/net/mlxsw/spectrum/mirror_gre_scale.sh index 8d2186c7c62b..f7c168decd1e 100644 --- a/tools/testing/selftests/drivers/net/mlxsw/spectrum/mirror_gre_scale.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/spectrum/mirror_gre_scale.sh @@ -4,10 +4,13 @@ source ../mirror_gre_scale.sh mirror_gre_get_target() { local should_fail=$1; shift + local target + + target=$(devlink_resource_size_get span_agents) if ((! should_fail)); then - echo 3 + echo $target else - echo 4 + echo $((target + 1)) fi }