aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2018-03-01 16:49:33 -0500
committerDavid S. Miller <davem@davemloft.net>2018-03-01 21:19:02 -0500
commit36b4c0adad2662464a5a392b592311524bd3a854 (patch)
tree89e52e16148b1a625f7f471322c4dfbc93b35668 /tools
parent993d337c242e292dca89de4558dd8ebfc216fc83 (diff)
selftests: forwarding: Add description to the multipath tests
Add a better description to the summary for multipath tests. e.g., INFO: Running IPv6 multipath tests TEST: ECMP [PASS] INFO: Expected ratio 1.00 Measured ratio 1.02 TEST: Weighted MP 2:1 [PASS] INFO: Expected ratio 2.00 Measured ratio 2.02 TEST: Weighted MP 11:45 [PASS] INFO: Expected ratio 4.09 Measured ratio 4.03 Signed-off-by: David Ahern <dsahern@gmail.com> Reviewed-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/net/forwarding/router_multipath.sh37
1 files changed, 20 insertions, 17 deletions
diff --git a/tools/testing/selftests/net/forwarding/router_multipath.sh b/tools/testing/selftests/net/forwarding/router_multipath.sh
index 745fb40bfa44..55595305a604 100755
--- a/tools/testing/selftests/net/forwarding/router_multipath.sh
+++ b/tools/testing/selftests/net/forwarding/router_multipath.sh
@@ -160,10 +160,11 @@ router2_destroy()
160 160
161multipath_eval() 161multipath_eval()
162{ 162{
163 local weight_rp12=$1 163 local desc="$1"
164 local weight_rp13=$2 164 local weight_rp12=$2
165 local packets_rp12=$3 165 local weight_rp13=$3
166 local packets_rp13=$4 166 local packets_rp12=$4
167 local packets_rp13=$5
167 local weights_ratio packets_ratio diff 168 local weights_ratio packets_ratio diff
168 169
169 RET=0 170 RET=0
@@ -192,14 +193,15 @@ multipath_eval()
192 193
193 test "$(echo "$diff / $weights_ratio > 0.1" | bc -l)" -eq 0 194 test "$(echo "$diff / $weights_ratio > 0.1" | bc -l)" -eq 0
194 check_err $? "Too large discrepancy between expected and measured ratios" 195 check_err $? "Too large discrepancy between expected and measured ratios"
195 log_test "Multipath" 196 log_test "$desc"
196 log_info "Expected ratio $weights_ratio Measured ratio $packets_ratio" 197 log_info "Expected ratio $weights_ratio Measured ratio $packets_ratio"
197} 198}
198 199
199multipath4_test() 200multipath4_test()
200{ 201{
201 local weight_rp12=$1 202 local desc="$1"
202 local weight_rp13=$2 203 local weight_rp12=$2
204 local weight_rp13=$3
203 local t0_rp12 t0_rp13 t1_rp12 t1_rp13 205 local t0_rp12 t0_rp13 t1_rp12 t1_rp13
204 local packets_rp12 packets_rp13 206 local packets_rp12 packets_rp13
205 local hash_policy 207 local hash_policy
@@ -224,7 +226,7 @@ multipath4_test()
224 226
225 let "packets_rp12 = $t1_rp12 - $t0_rp12" 227 let "packets_rp12 = $t1_rp12 - $t0_rp12"
226 let "packets_rp13 = $t1_rp13 - $t0_rp13" 228 let "packets_rp13 = $t1_rp13 - $t0_rp13"
227 multipath_eval $weight_rp12 $weight_rp13 $packets_rp12 $packets_rp13 229 multipath_eval "$desc" $weight_rp12 $weight_rp13 $packets_rp12 $packets_rp13
228 230
229 # Restore settings. 231 # Restore settings.
230 ip route replace 198.51.100.0/24 vrf vrf-r1 \ 232 ip route replace 198.51.100.0/24 vrf vrf-r1 \
@@ -235,8 +237,9 @@ multipath4_test()
235 237
236multipath6_test() 238multipath6_test()
237{ 239{
238 local weight_rp12=$1 240 local desc="$1"
239 local weight_rp13=$2 241 local weight_rp12=$2
242 local weight_rp13=$3
240 local t0_rp12 t0_rp13 t1_rp12 t1_rp13 243 local t0_rp12 t0_rp13 t1_rp12 t1_rp13
241 local packets_rp12 packets_rp13 244 local packets_rp12 packets_rp13
242 245
@@ -257,7 +260,7 @@ multipath6_test()
257 260
258 let "packets_rp12 = $t1_rp12 - $t0_rp12" 261 let "packets_rp12 = $t1_rp12 - $t0_rp12"
259 let "packets_rp13 = $t1_rp13 - $t0_rp13" 262 let "packets_rp13 = $t1_rp13 - $t0_rp13"
260 multipath_eval $weight_rp12 $weight_rp13 $packets_rp12 $packets_rp13 263 multipath_eval "$desc" $weight_rp12 $weight_rp13 $packets_rp12 $packets_rp13
261 264
262 ip route replace 2001:db8:2::/64 vrf vrf-r1 \ 265 ip route replace 2001:db8:2::/64 vrf vrf-r1 \
263 nexthop via fe80:2::22 dev $rp12 \ 266 nexthop via fe80:2::22 dev $rp12 \
@@ -267,14 +270,14 @@ multipath6_test()
267multipath_test() 270multipath_test()
268{ 271{
269 log_info "Running IPv4 multipath tests" 272 log_info "Running IPv4 multipath tests"
270 multipath4_test 1 1 273 multipath4_test "ECMP" 1 1
271 multipath4_test 2 1 274 multipath4_test "Weighted MP 2:1" 2 1
272 multipath4_test 11 45 275 multipath4_test "Weighted MP 11:45" 11 45
273 276
274 log_info "Running IPv6 multipath tests" 277 log_info "Running IPv6 multipath tests"
275 multipath6_test 1 1 278 multipath6_test "ECMP" 1 1
276 multipath6_test 2 1 279 multipath6_test "Weighted MP 2:1" 2 1
277 multipath6_test 11 45 280 multipath6_test "Weighted MP 11:45" 11 45
278} 281}
279 282
280setup_prepare() 283setup_prepare()