Skip to content

Commit bbbd531

Browse files
fmaurer-rhPaolo Abeni
authored andcommitted
selftests: hsr: Add more link fault tests for HSR
Run the packet loss and reordering tests also for both HSR versions. Now they can be removed from the hsr_ping tests completely. The timeout needs to be increased because there are 15 link fault test cases now, with each of them taking 5-6sec for the test and at most 5sec for the HSR node tables to get merged and we also want some room to make the test runs stable. Signed-off-by: Felix Maurer <fmaurer@redhat.com> Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Link: https://patch.msgid.link/eb6f667d3804ce63d86f0ee3fbc0e0ac9e1a209a.1770299429.git.fmaurer@redhat.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent aae9d6b commit bbbd531

3 files changed

Lines changed: 44 additions & 28 deletions

File tree

tools/testing/selftests/net/hsr/hsr_ping.sh

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -90,27 +90,6 @@ do_ping_tests()
9090
stop_if_error "Longer ping test failed (ns3)."
9191
}
9292

93-
do_link_problem_tests()
94-
{
95-
echo "INFO: Running link problem tests."
96-
97-
echo "INFO: Delay the link and drop a few packages."
98-
tc -net "$ns3" qdisc add dev ns3eth1 root netem delay 50ms
99-
tc -net "$ns2" qdisc add dev ns2eth1 root netem delay 5ms loss 25%
100-
101-
do_ping_long "$ns1" 100.64.0.2
102-
do_ping_long "$ns1" 100.64.0.3
103-
stop_if_error "Failed with delay and packetloss (ns1)."
104-
105-
do_ping_long "$ns2" 100.64.0.1
106-
do_ping_long "$ns2" 100.64.0.3
107-
stop_if_error "Failed with delay and packetloss (ns2)."
108-
109-
do_ping_long "$ns3" 100.64.0.1
110-
do_ping_long "$ns3" 100.64.0.2
111-
stop_if_error "Failed with delay and packetloss (ns3)."
112-
}
113-
11493
setup_hsr_interfaces()
11594
{
11695
local HSRv="$1"
@@ -190,11 +169,10 @@ setup_vlan_interfaces() {
190169

191170
}
192171

193-
run_complete_ping_tests()
172+
run_ping_tests()
194173
{
195-
echo "INFO: Running complete ping tests."
174+
echo "INFO: Running ping tests."
196175
do_ping_tests 0
197-
do_link_problem_tests
198176
}
199177

200178
run_vlan_tests()
@@ -204,7 +182,7 @@ run_vlan_tests()
204182
vlan_challenged_hsr3=$(ip net exec "$ns3" ethtool -k hsr3 | grep "vlan-challenged" | awk '{print $2}')
205183

206184
if [[ "$vlan_challenged_hsr1" = "off" || "$vlan_challenged_hsr2" = "off" || "$vlan_challenged_hsr3" = "off" ]]; then
207-
echo "INFO: Running VLAN tests"
185+
echo "INFO: Running VLAN ping tests"
208186
setup_vlan_interfaces
209187
do_ping_tests 2
210188
else
@@ -217,12 +195,12 @@ trap cleanup_all_ns EXIT
217195

218196
setup_ns ns1 ns2 ns3
219197
setup_hsr_interfaces 0
220-
run_complete_ping_tests
198+
run_ping_tests
221199
run_vlan_tests
222200

223201
setup_ns ns1 ns2 ns3
224202
setup_hsr_interfaces 1
225-
run_complete_ping_tests
203+
run_ping_tests
226204
run_vlan_tests
227205

228206
exit $ret

tools/testing/selftests/net/hsr/link_faults.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@ source ../lib.sh
77
ALL_TESTS="
88
test_clean_hsrv0
99
test_cut_link_hsrv0
10+
test_packet_loss_hsrv0
11+
test_high_packet_loss_hsrv0
12+
test_reordering_hsrv0
13+
1014
test_clean_hsrv1
1115
test_cut_link_hsrv1
16+
test_packet_loss_hsrv1
17+
test_high_packet_loss_hsrv1
18+
test_reordering_hsrv1
19+
1220
test_clean_prp
1321
test_cut_link_prp
1422
test_packet_loss_prp
@@ -292,11 +300,31 @@ test_packet_loss()
292300
log_test "${tname}"
293301
}
294302

303+
test_packet_loss_hsrv0()
304+
{
305+
test_packet_loss "HSRv0" "20%"
306+
}
307+
308+
test_packet_loss_hsrv1()
309+
{
310+
test_packet_loss "HSRv1" "20%"
311+
}
312+
295313
test_packet_loss_prp()
296314
{
297315
test_packet_loss "PRP" "20%"
298316
}
299317

318+
test_high_packet_loss_hsrv0()
319+
{
320+
test_packet_loss "HSRv0" "80%"
321+
}
322+
323+
test_high_packet_loss_hsrv1()
324+
{
325+
test_packet_loss "HSRv1" "80%"
326+
}
327+
300328
test_high_packet_loss_prp()
301329
{
302330
test_packet_loss "PRP" "80%"
@@ -323,6 +351,16 @@ test_reordering()
323351
log_test "${tname}"
324352
}
325353

354+
test_reordering_hsrv0()
355+
{
356+
test_reordering "HSRv0"
357+
}
358+
359+
test_reordering_hsrv1()
360+
{
361+
test_reordering "HSRv1"
362+
}
363+
326364
test_reordering_prp()
327365
{
328366
test_reordering "PRP"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
timeout=90
1+
timeout=180

0 commit comments

Comments
 (0)