git: 9d48283d6028 - main - carp tests: test manually switch between backup and master
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 20 Mar 2023 10:18:03 UTC
The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9d48283d60284eb62fd32d2d8113cbf0beca28b3 commit 9d48283d60284eb62fd32d2d8113cbf0beca28b3 Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2023-03-16 10:16:24 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2023-03-20 09:52:53 +0000 carp tests: test manually switch between backup and master There's been at least one issue where we failed to correctly enter NET_EPOCH that was triggered in this scenario. Add a test case for it to make it easier to detect issues like this in the future. Reviewed by: zlei Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D39115 --- tests/sys/netinet/carp.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/sys/netinet/carp.sh b/tests/sys/netinet/carp.sh index d31a17ed6beb..9afe9d2ea8c1 100755 --- a/tests/sys/netinet/carp.sh +++ b/tests/sys/netinet/carp.sh @@ -263,10 +263,35 @@ nd6_ns_source_mac_cleanup() } +atf_test_case "switch" "cleanup" +switch_head() +{ + atf_set descr 'Switch between master and backup' + atf_set require.user root +} + +switch_body() +{ + carp_init + + epair=$(vnet_mkepair) + + ifconfig ${epair}a up + ifconfig ${epair}a vhid 1 advskew 100 192.0.2.1/24 + ifconfig ${epair}a vhid 1 state backup + ifconfig ${epair}a vhid 1 state master +} + +switch_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic_v4" atf_add_test_case "basic_v6" atf_add_test_case "negative_demotion" atf_add_test_case "nd6_ns_source_mac" + atf_add_test_case "switch" }