]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests: hsr: Add more link fault tests for HSR
authorFelix Maurer <fmaurer@redhat.com>
Thu, 5 Feb 2026 13:57:34 +0000 (14:57 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 10 Feb 2026 11:02:29 +0000 (12:02 +0100)
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>
tools/testing/selftests/net/hsr/hsr_ping.sh
tools/testing/selftests/net/hsr/link_faults.sh
tools/testing/selftests/net/hsr/settings

index 0ec71b20ab75e4d55f9ecf5ac2aae22aa5ca7541..f4d685df43457fb90cd94ac4bcfb5ed6d928bb71 100755 (executable)
@@ -90,27 +90,6 @@ do_ping_tests()
        stop_if_error "Longer ping test failed (ns3)."
 }
 
-do_link_problem_tests()
-{
-       echo "INFO: Running link problem tests."
-
-       echo "INFO: Delay the link and drop a few packages."
-       tc -net "$ns3" qdisc add dev ns3eth1 root netem delay 50ms
-       tc -net "$ns2" qdisc add dev ns2eth1 root netem delay 5ms loss 25%
-
-       do_ping_long "$ns1" 100.64.0.2
-       do_ping_long "$ns1" 100.64.0.3
-       stop_if_error "Failed with delay and packetloss (ns1)."
-
-       do_ping_long "$ns2" 100.64.0.1
-       do_ping_long "$ns2" 100.64.0.3
-       stop_if_error "Failed with delay and packetloss (ns2)."
-
-       do_ping_long "$ns3" 100.64.0.1
-       do_ping_long "$ns3" 100.64.0.2
-       stop_if_error "Failed with delay and packetloss (ns3)."
-}
-
 setup_hsr_interfaces()
 {
        local HSRv="$1"
@@ -190,11 +169,10 @@ setup_vlan_interfaces() {
 
 }
 
-run_complete_ping_tests()
+run_ping_tests()
 {
-       echo "INFO: Running complete ping tests."
+       echo "INFO: Running ping tests."
        do_ping_tests 0
-       do_link_problem_tests
 }
 
 run_vlan_tests()
@@ -204,7 +182,7 @@ run_vlan_tests()
        vlan_challenged_hsr3=$(ip net exec "$ns3" ethtool -k hsr3 | grep "vlan-challenged" | awk '{print $2}')
 
        if [[ "$vlan_challenged_hsr1" = "off" || "$vlan_challenged_hsr2" = "off" || "$vlan_challenged_hsr3" = "off" ]]; then
-               echo "INFO: Running VLAN tests"
+               echo "INFO: Running VLAN ping tests"
                setup_vlan_interfaces
                do_ping_tests 2
        else
@@ -217,12 +195,12 @@ trap cleanup_all_ns EXIT
 
 setup_ns ns1 ns2 ns3
 setup_hsr_interfaces 0
-run_complete_ping_tests
+run_ping_tests
 run_vlan_tests
 
 setup_ns ns1 ns2 ns3
 setup_hsr_interfaces 1
-run_complete_ping_tests
+run_ping_tests
 run_vlan_tests
 
 exit $ret
index 1959bea171470e632db187adccf8f98666c1f32a..be526281571c5aa7950a50b5066edd6cdf8689ed 100755 (executable)
@@ -7,8 +7,16 @@ source ../lib.sh
 ALL_TESTS="
        test_clean_hsrv0
        test_cut_link_hsrv0
+       test_packet_loss_hsrv0
+       test_high_packet_loss_hsrv0
+       test_reordering_hsrv0
+
        test_clean_hsrv1
        test_cut_link_hsrv1
+       test_packet_loss_hsrv1
+       test_high_packet_loss_hsrv1
+       test_reordering_hsrv1
+
        test_clean_prp
        test_cut_link_prp
        test_packet_loss_prp
@@ -292,11 +300,31 @@ test_packet_loss()
        log_test "${tname}"
 }
 
+test_packet_loss_hsrv0()
+{
+       test_packet_loss "HSRv0" "20%"
+}
+
+test_packet_loss_hsrv1()
+{
+       test_packet_loss "HSRv1" "20%"
+}
+
 test_packet_loss_prp()
 {
        test_packet_loss "PRP" "20%"
 }
 
+test_high_packet_loss_hsrv0()
+{
+       test_packet_loss "HSRv0" "80%"
+}
+
+test_high_packet_loss_hsrv1()
+{
+       test_packet_loss "HSRv1" "80%"
+}
+
 test_high_packet_loss_prp()
 {
        test_packet_loss "PRP" "80%"
@@ -323,6 +351,16 @@ test_reordering()
        log_test "${tname}"
 }
 
+test_reordering_hsrv0()
+{
+       test_reordering "HSRv0"
+}
+
+test_reordering_hsrv1()
+{
+       test_reordering "HSRv1"
+}
+
 test_reordering_prp()
 {
        test_reordering "PRP"
index ba4d85f74cd6b9a671652d2610ac08bbd386a577..a953c96aa16e1e814867b33d06e894ffb664bb1b 100644 (file)
@@ -1 +1 @@
-timeout=90
+timeout=180