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"
}
-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()
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
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
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
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%"
log_test "${tname}"
}
+test_reordering_hsrv0()
+{
+ test_reordering "HSRv0"
+}
+
+test_reordering_hsrv1()
+{
+ test_reordering "HSRv1"
+}
+
test_reordering_prp()
{
test_reordering "PRP"