Commit cbf2ec50 authored by David S. Miller's avatar David S. Miller

Merge branch 'mlxsw-selftest-fixes'

Petr Machata says:

====================
selftests: mlxsw: Fixes

This patch set carries fixes to selftest issues that we have hit in our
nightly regression run. Almost all are in mlxsw selftests, though one is in
a generic forwarding selftest.

- In patch #1, in an ERSPAN test, install an FDB entry as static instead of
  (implicitly) as local.

- In the mlxsw resource-scale test, an if statement overrides the value of
  $?, which is supposed to contain the result of the test. As a result, the
  resource scale test can spuriously pass.

  In patches #2 and #3, remove the if statements to fix the issue in,
  respectively, port_scale test and tc_flower_scale tests.

- Again in the mlxsw resource-scale test, when more then one sub-test is
  run, a successful sub-test overrides any previous failures. This causes a
  spurious pass of the overall test. This is fixed in patch #4.

- In patch #5, increase a tolerance in a mlxsw-specific RED backlog test.
  This test is very noisy, due to rounding errors and the unpredictability
  of software traffic generation. By bumping the tolerance from 5 % to 10,
  get the failure rate to zero. This shouldn't impact the accuracy,
  mistakes in backlog configuration (e.g. due to wrong cell size) are
  likely to cause a much larger discrepancy.

- In patch #6, fix mausezahn invocation in the mlxsw ERSPAN scale
  test. The test failed because of the wrong invocation.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents e40fa65c 1233898a
...@@ -120,12 +120,13 @@ __mirror_gre_test() ...@@ -120,12 +120,13 @@ __mirror_gre_test()
sleep 5 sleep 5
for ((i = 0; i < count; ++i)); do for ((i = 0; i < count; ++i)); do
local sip=$(mirror_gre_ipv6_addr 1 $i)::1
local dip=$(mirror_gre_ipv6_addr 1 $i)::2 local dip=$(mirror_gre_ipv6_addr 1 $i)::2
local htun=h3-gt6-$i local htun=h3-gt6-$i
local message local message
icmp6_capture_install $htun icmp6_capture_install $htun
mirror_test v$h1 "" $dip $htun 100 10 mirror_test v$h1 $sip $dip $htun 100 10
icmp6_capture_uninstall $htun icmp6_capture_uninstall $htun
done done
} }
......
...@@ -55,10 +55,6 @@ port_test() ...@@ -55,10 +55,6 @@ port_test()
| jq '.[][][] | select(.name=="physical_ports") |.["occ"]') | jq '.[][][] | select(.name=="physical_ports") |.["occ"]')
[[ $occ -eq $max_ports ]] [[ $occ -eq $max_ports ]]
if [[ $should_fail -eq 0 ]]; then check_err_fail $should_fail $? "Attempt to create $max_ports ports (actual result $occ)"
check_err $? "Mismatch ports number: Expected $max_ports, got $occ."
else
check_err_fail $should_fail $? "Reached more ports than expected"
fi
} }
...@@ -507,8 +507,8 @@ do_red_test() ...@@ -507,8 +507,8 @@ do_red_test()
check_err $? "backlog $backlog / $limit Got $pct% marked packets, expected == 0." check_err $? "backlog $backlog / $limit Got $pct% marked packets, expected == 0."
local diff=$((limit - backlog)) local diff=$((limit - backlog))
pct=$((100 * diff / limit)) pct=$((100 * diff / limit))
((0 <= pct && pct <= 5)) ((0 <= pct && pct <= 10))
check_err $? "backlog $backlog / $limit expected <= 5% distance" check_err $? "backlog $backlog / $limit expected <= 10% distance"
log_test "TC $((vlan - 10)): RED backlog > limit" log_test "TC $((vlan - 10)): RED backlog > limit"
stop_traffic stop_traffic
......
...@@ -30,6 +30,7 @@ trap cleanup EXIT ...@@ -30,6 +30,7 @@ trap cleanup EXIT
ALL_TESTS="router tc_flower mirror_gre tc_police port" ALL_TESTS="router tc_flower mirror_gre tc_police port"
for current_test in ${TESTS:-$ALL_TESTS}; do for current_test in ${TESTS:-$ALL_TESTS}; do
RET_FIN=0
source ${current_test}_scale.sh source ${current_test}_scale.sh
num_netifs_var=${current_test^^}_NUM_NETIFS num_netifs_var=${current_test^^}_NUM_NETIFS
...@@ -48,8 +49,9 @@ for current_test in ${TESTS:-$ALL_TESTS}; do ...@@ -48,8 +49,9 @@ for current_test in ${TESTS:-$ALL_TESTS}; do
else else
log_test "'$current_test' overflow $target" log_test "'$current_test' overflow $target"
fi fi
RET_FIN=$(( RET_FIN || RET ))
done done
done done
current_test="" current_test=""
exit "$RET" exit "$RET_FIN"
...@@ -24,6 +24,7 @@ trap cleanup EXIT ...@@ -24,6 +24,7 @@ trap cleanup EXIT
ALL_TESTS="router tc_flower mirror_gre tc_police port" ALL_TESTS="router tc_flower mirror_gre tc_police port"
for current_test in ${TESTS:-$ALL_TESTS}; do for current_test in ${TESTS:-$ALL_TESTS}; do
RET_FIN=0
source ${current_test}_scale.sh source ${current_test}_scale.sh
num_netifs_var=${current_test^^}_NUM_NETIFS num_netifs_var=${current_test^^}_NUM_NETIFS
...@@ -50,8 +51,9 @@ for current_test in ${TESTS:-$ALL_TESTS}; do ...@@ -50,8 +51,9 @@ for current_test in ${TESTS:-$ALL_TESTS}; do
log_test "'$current_test' [$profile] overflow $target" log_test "'$current_test' [$profile] overflow $target"
fi fi
done done
RET_FIN=$(( RET_FIN || RET ))
done done
done done
current_test="" current_test=""
exit "$RET" exit "$RET_FIN"
...@@ -98,11 +98,7 @@ __tc_flower_test() ...@@ -98,11 +98,7 @@ __tc_flower_test()
jq -r '[ .[] | select(.kind == "flower") | jq -r '[ .[] | select(.kind == "flower") |
.options | .in_hw ]' | jq .[] | wc -l) .options | .in_hw ]' | jq .[] | wc -l)
[[ $((offload_count - 1)) -eq $count ]] [[ $((offload_count - 1)) -eq $count ]]
if [[ $should_fail -eq 0 ]]; then check_err_fail $should_fail $? "Attempt to offload $count rules (actual result $((offload_count - 1)))"
check_err $? "Offload mismatch"
else
check_err_fail $should_fail $? "Offload more than expacted"
fi
} }
tc_flower_test() tc_flower_test()
......
...@@ -271,7 +271,7 @@ test_span_gre_fdb_roaming() ...@@ -271,7 +271,7 @@ test_span_gre_fdb_roaming()
while ((RET == 0)); do while ((RET == 0)); do
bridge fdb del dev $swp3 $h3mac vlan 555 master 2>/dev/null bridge fdb del dev $swp3 $h3mac vlan 555 master 2>/dev/null
bridge fdb add dev $swp2 $h3mac vlan 555 master bridge fdb add dev $swp2 $h3mac vlan 555 master static
sleep 1 sleep 1
fail_test_span_gre_dir $tundev ingress fail_test_span_gre_dir $tundev ingress
......
...@@ -20,6 +20,13 @@ mirror_uninstall() ...@@ -20,6 +20,13 @@ mirror_uninstall()
tc filter del dev $swp1 $direction pref 1000 tc filter del dev $swp1 $direction pref 1000
} }
is_ipv6()
{
local addr=$1; shift
[[ -z ${addr//[0-9a-fA-F:]/} ]]
}
mirror_test() mirror_test()
{ {
local vrf_name=$1; shift local vrf_name=$1; shift
...@@ -29,9 +36,17 @@ mirror_test() ...@@ -29,9 +36,17 @@ mirror_test()
local pref=$1; shift local pref=$1; shift
local expect=$1; shift local expect=$1; shift
if is_ipv6 $dip; then
local proto=-6
local type="icmp6 type=128" # Echo request.
else
local proto=
local type="icmp echoreq"
fi
local t0=$(tc_rule_stats_get $dev $pref) local t0=$(tc_rule_stats_get $dev $pref)
$MZ $vrf_name ${sip:+-A $sip} -B $dip -a own -b bc -q \ $MZ $proto $vrf_name ${sip:+-A $sip} -B $dip -a own -b bc -q \
-c 10 -d 100msec -t icmp type=8 -c 10 -d 100msec -t $type
sleep 0.5 sleep 0.5
local t1=$(tc_rule_stats_get $dev $pref) local t1=$(tc_rule_stats_get $dev $pref)
local delta=$((t1 - t0)) local delta=$((t1 - t0))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment