aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2025-12-04 18:41:19 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2025-12-04 18:52:01 +0000
commit27ff90cd3d8d2ac8198f30cbebeefb15a49d41bc (patch)
tree62dcc70fd4ad9db24cd2b4aa2914bd302862c0c6
parente353cbffd600ae3c00c8584dddcabf9d0ae1202a (diff)
tests/carp: make a 0.2 second pause before configuring second jail
for all scenarios where both jails have same priority/advskew. There is a tiny chance that on both sides carp_master_down() will be executed in parallel and advertisements will also fly through the bridge(4) in parallel, thus both sides will switch to MASTER before receiving the announcement from peer. This makes the test to fail. So far this flakyness was observed for carp:vrrp_v4 only, but in theory it is possible for any of the patched scenarios. Note that this sleep does not prolong execution of the tests, as the first jail is already configured, and if we slept before configuring the second, we would sleep less in wait_for_carp().
-rwxr-xr-xtests/sys/netinet/carp.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/sys/netinet/carp.sh b/tests/sys/netinet/carp.sh
index a9c99a7d701f..90ed9d6f9baf 100755
--- a/tests/sys/netinet/carp.sh
+++ b/tests/sys/netinet/carp.sh
@@ -90,6 +90,7 @@ basic_v4_body()
jexec carp_basic_v4_two ifconfig ${epair_one}b 192.0.2.202/29 up
jexec carp_basic_v4_two ifconfig ${epair_one}b add vhid 1 192.0.2.1/29
+ sleep 0.2
jexec carp_basic_v4_three ifconfig ${epair_two}b 192.0.2.203/29 up
jexec carp_basic_v4_three ifconfig ${epair_two}b add vhid 1 \
192.0.2.1/29
@@ -137,6 +138,7 @@ vrrp_v4_body()
jexec ${j}_two ifconfig ${epair_one}b 192.0.2.202/29 up
jexec ${j}_two ifconfig ${epair_one}b add vhid 1 carpver 3 192.0.2.1/29
+ sleep 0.2
jexec ${j}_three ifconfig ${epair_two}b 192.0.2.203/29 up
jexec ${j}_three ifconfig ${epair_two}b add vhid 1 carpver 3 \
192.0.2.1/29
@@ -182,6 +184,7 @@ unicast_v4_body()
jexec carp_uni_v4_two ifconfig ${epair_one}b add vhid 1 \
peer 198.51.100.224 192.0.2.1/32
+ sleep 0.2
jexec carp_uni_v4_three sysctl net.inet.ip.forwarding=1
jexec carp_uni_v4_three ifconfig ${epair_two}b 198.51.100.224/25 up
jexec carp_uni_v4_three route add 198.51.100.2 198.51.100.129
@@ -253,6 +256,7 @@ basic_v6_body()
jexec carp_basic_v6_two ifconfig ${epair_one}b inet6 add vhid 1 \
2001:db8::0:1/64
+ sleep 0.2
jexec carp_basic_v6_three ifconfig ${epair_two}b inet6 2001:db8::1:3/64 up no_dad
jexec carp_basic_v6_three ifconfig ${epair_two}b inet6 add vhid 1 \
2001:db8::0:1/64
@@ -303,6 +307,7 @@ vrrp_v6_body()
jexec ${j}_two ifconfig ${epair_one}b inet6 add vhid 1 carpver 3 \
2001:db8::0:1/64
+ sleep 0.2
jexec ${j}_three ifconfig ${epair_two}b inet6 2001:db8::1:3/64 up no_dad
jexec ${j}_three ifconfig ${epair_two}b inet6 add vhid 1 carpver 3 \
2001:db8::0:1/64
@@ -358,6 +363,7 @@ unicast_v6_body()
peer6 2001:db8:2::2 \
2001:db8::0:1/64
+ sleep 0.2
jexec carp_uni_v6_three ifconfig ${epair_two}b inet6 2001:db8:2::2/64 \
no_dad up
jexec carp_uni_v6_three route -6 add default 2001:db8:2::1
@@ -423,6 +429,7 @@ unicast_ll_v6_body()
jexec ${j}_two ifconfig ${epair_one}b inet6 add vhid 1 \
peer6 ${ll_two} \
2001:db8::0:1/64
+ sleep 0.2
jexec ${j}_three ifconfig ${epair_two}b inet6 add vhid 1 \
peer6 ${ll_one} \
2001:db8::0:1/64