From nobody Wed May 08 11:19:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VZCNc5Wpdz5Kt5B; Wed, 08 May 2024 11:20:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VZCNb6ycyz49Zc; Wed, 8 May 2024 11:19:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715167200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KLhxBtyAwxfDIjJuQtwbX/6KzNCKdJrXCYpHIdklGZk=; b=xEIfH+Q1kb7wg5pWQPa5HR9bU4yFuo6HeZCh3GcnZwnnm5wTYfgzBsE1r2Oe32m/98Tk8P dUIaOO4TnRjT2sMw03qcU/pCjpEuztd0V9OqlUnZ6uO0fyg4wUk2Qs8tkpy6xEBbMjLTwV abUVD/Q39AMwPOls5kGOGahbCYvxQs/Se6EOWgtO1m1NufWxd3pOC/cOtSDScaVni1AP5P GBUSEv+oVdsi/NHhp1sEZrdUqefIYX6RBjoUUGZmcwa3fHbNdCrHCF/zlWFWFeBzCNFUNa Z+CUQ9iBEu9lMNZ1cfLIm3s1zGI3LwgVx8d4RzQu+HL3trfpg2GVq9SXLsQeSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715167200; a=rsa-sha256; cv=none; b=n+eFdV9Bo5AJufl52XaONhPBoDsThaVU1W8/vPNH2NyBglfQDSLAcI1hmwbopBXIs7GdyC Vd1sG5iFF8vQvzs7Q48DangUN+H4cYLiSqGoOvIx7JZ9O0pBOx4OlN21YFjsistSsxAiyD etHlMkgSzXVlYCQNEdjTJokjUgUKid/wCy+QLkYSyCg00BcVvyUbL8DKp3uIzzdQYaGO4p +ILlLIy/n8XUA8K+UMVpOjisECfuQb4Rr0cAcX+n7IK4606u2Si0uatdkgd9Cbz9OnQnyZ gUUmQl4XhQGHtJOmmo9O85kw8lkaYdNfcWoPMrbKK6blPoRzmP3Q/xnunFfNew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715167200; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KLhxBtyAwxfDIjJuQtwbX/6KzNCKdJrXCYpHIdklGZk=; b=yfMeufwrfKd3vNGc6PoGKLhyMIW7uSRnIgzmLvP2lb2V6/f0bYC1JWF1WE5idBioBozUmT 9tsJrDA4AwcinXg66G/efvg0X+STQSVEaLr9vPeednf6qtxiy2PW7UCb+1GptmrwMjzxk0 LvWcNT6BmhYaNr2fHHddTD3L/PhBWwEIpGj+72KbWzboskz2uFayeSdf3SJ/VCtCcLH5Ez eQb2HXncV/tucRrHyprOEcB09xblg5NkZTRRuBdjhLEVqVvMbF32mV2Dd5PbFwgnNtbaoV DVRhi9JhdtXmPFDjRkQq+ojuvRvecctIWVe+dfl8YfzXY7U/cIuLW81NFnDQKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VZCNb6XsRzN55; Wed, 8 May 2024 11:19:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 448BJxhM094751; Wed, 8 May 2024 11:19:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 448BJxT6094748; Wed, 8 May 2024 11:19:59 GMT (envelope-from git) Date: Wed, 8 May 2024 11:19:59 GMT Message-Id: <202405081119.448BJxT6094748@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 5311e7333714 - main - netinet tests: basic VRRP tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5311e73337143b2a32e06bd68fb125089c827323 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5311e73337143b2a32e06bd68fb125089c827323 commit 5311e73337143b2a32e06bd68fb125089c827323 Author: Kristof Provost AuthorDate: 2024-04-11 16:40:19 +0000 Commit: Kristof Provost CommitDate: 2024-05-08 11:19:04 +0000 netinet tests: basic VRRP tests Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D44775 --- tests/sys/netinet/carp.py | 14 +++++++ tests/sys/netinet/carp.sh | 98 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 111 insertions(+), 1 deletion(-) diff --git a/tests/sys/netinet/carp.py b/tests/sys/netinet/carp.py index ac2c5547fe97..0db31e79ba84 100644 --- a/tests/sys/netinet/carp.py +++ b/tests/sys/netinet/carp.py @@ -51,3 +51,17 @@ class TestCarp(VnetTestTemplate): carp_pkts = sc.sniff(iface=if1.name, stop_filter=filter_f, timeout=5) self.check_carp_src_mac(carp_pkts) + + def test_source_mac_vrrp(self): + "Test VRRP packets source address" + + if1 = self.vnet.iface_alias_map["if1"] + + ToolsHelper.print_output( + "ifconfig {} add vhid 1 carpver 3 192.0.2.203/24".format(if1.name) + ) + + carp_pkts = sc.sniff(iface=if1.name, stop_filter=filter_f, timeout=5) + + self.check_carp_src_mac(carp_pkts) + 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"