aboutsummaryrefslogtreecommitdiff
path: root/tests/sys/netinet/carp.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/sys/netinet/carp.sh')
-rwxr-xr-xtests/sys/netinet/carp.sh98
1 files changed, 97 insertions, 1 deletions
diff --git a/tests/sys/netinet/carp.sh b/tests/sys/netinet/carp.sh
index d08940d433d7..e10e24747c2d 100755
--- a/tests/sys/netinet/carp.sh
+++ b/tests/sys/netinet/carp.sh
@@ -31,7 +31,7 @@ is_master()
jail=$1
itf=$2
- jexec ${jail} ifconfig ${itf} | grep carp | grep MASTER
+ jexec ${jail} ifconfig ${itf} | grep -E '(carp|vrrp)' | grep MASTER
}
wait_for_carp()
@@ -105,6 +105,51 @@ basic_v4_cleanup()
vnet_cleanup
}
+atf_test_case "vrrp_v4" "cleanup"
+vrrp_v4_head()
+{
+ atf_set descr 'Basic VRRP test (IPv4)'
+ atf_set require.user root
+}
+
+vrrp_v4_body()
+{
+ carp_init
+
+ j=vrrp_basic_v4
+
+ bridge=$(vnet_mkbridge)
+ epair_one=$(vnet_mkepair)
+ epair_two=$(vnet_mkepair)
+
+ vnet_mkjail ${j}_one ${bridge} ${epair_one}a ${epair_two}a
+ vnet_mkjail ${j}_two ${epair_one}b
+ vnet_mkjail ${j}_three ${epair_two}b
+
+ jexec ${j}_one ifconfig ${bridge} 192.0.2.4/29 up
+ jexec ${j}_one ifconfig ${bridge} addm ${epair_one}a \
+ addm ${epair_two}a
+ jexec ${j}_one ifconfig ${epair_one}a up
+ jexec ${j}_one ifconfig ${epair_two}a up
+
+ 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
+
+ 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
+
+ wait_for_carp ${j}_two ${epair_one}b \
+ ${j}_three ${epair_two}b
+
+ atf_check -s exit:0 -o ignore jexec ${j}_one \
+ ping -c 3 192.0.2.1
+}
+
+vrrp_v4_cleanup()
+{
+ vnet_cleanup
+}
atf_test_case "unicast_v4" "cleanup"
unicast_v4_head()
@@ -210,6 +255,55 @@ basic_v6_cleanup()
vnet_cleanup
}
+atf_test_case "vrrp_v6" "cleanup"
+vrrp_v6_head()
+{
+ atf_set descr 'Basic VRRP test (IPv6)'
+ atf_set require.user root
+}
+
+vrrp_v6_body()
+{
+ carp_init
+
+ j=carp_basic_v6
+
+ bridge=$(vnet_mkbridge)
+ epair_one=$(vnet_mkepair)
+ epair_two=$(vnet_mkepair)
+
+ vnet_mkjail ${j}_one ${bridge} ${epair_one}a ${epair_two}a
+ vnet_mkjail ${j}_two ${epair_one}b
+ vnet_mkjail ${j}_three ${epair_two}b
+
+ jexec ${j}_one ifconfig ${bridge} inet6 2001:db8::0:4/64 up \
+ no_dad
+ jexec ${j}_one ifconfig ${bridge} addm ${epair_one}a \
+ addm ${epair_two}a
+ jexec ${j}_one ifconfig ${epair_one}a up
+ jexec ${j}_one ifconfig ${epair_two}a up
+
+ jexec ${j}_two ifconfig ${epair_one}b inet6 \
+ 2001:db8::1:2/64 up no_dad
+ jexec ${j}_two ifconfig ${epair_one}b inet6 add vhid 1 carpver 3 \
+ 2001:db8::0:1/64
+
+ 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
+
+ wait_for_carp ${j}_two ${epair_one}b \
+ ${j}_three ${epair_two}b
+
+ atf_check -s exit:0 -o ignore jexec ${j}_one \
+ ping -6 -c 3 2001:db8::0:1
+}
+
+vrrp_v6_cleanup()
+{
+ vnet_cleanup
+}
+
atf_test_case "unicast_v6" "cleanup"
unicast_v6_head()
{
@@ -469,8 +563,10 @@ switch_cleanup()
atf_init_test_cases()
{
atf_add_test_case "basic_v4"
+ atf_add_test_case "vrrp_v4"
atf_add_test_case "unicast_v4"
atf_add_test_case "basic_v6"
+ atf_add_test_case "vrrp_v6"
atf_add_test_case "unicast_v6"
atf_add_test_case "unicast_ll_v6"
atf_add_test_case "negative_demotion"