From nobody Mon Mar 20 14:14:25 2023 X-Original-To: dev-commits-src-main@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 4PgGvQ0bQQz3yn2W; Mon, 20 Mar 2023 14:14:26 +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 4PgGvP71V5z3k8v; Mon, 20 Mar 2023 14:14:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679321666; 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=MQmZhkSlJVI0sPmsTn4j4m/3n6QdCI6V57D+lJxsKeQ=; b=ea2liBj/mhrmJ6WSXTvLG9UR1bV0WPacouT1IfsTyuai8bbKdnTri9PGkofAR0HNQMsl14 JMpDbgTSipJcI5wszs20Pz/ETGAqcfFTZAglt49/AMqLN//snZdl4qwRrNgT6UOL2yg/za vouDBqBYfW0Pn6S72GUqZFNAO/KX6oJx954MF6OzpRwazthKGErzWgGx+cWDNfHni4nOkA N14YhEOX2VIDt5ygCqyEj630ft/0S7a7jxDk72WoiaK5M0qd5YoVnel4KQn5fjjkTt11Df ojo9bw7i35IClWdzH40Wb9cvDFGY3k1INx5tsJIo+b0OBbJvxhSOCOLo2WK3GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679321666; 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=MQmZhkSlJVI0sPmsTn4j4m/3n6QdCI6V57D+lJxsKeQ=; b=jAexL5xPsgWf83nCGDIVLPCUOKWZI6PyTUrNyBajEJarsUDuYmLPXGHWDCDiZxdqDlhB5Z IWbcLJ+js9i5k6rzx4501Piw7MFc1ppm0bUOvgQwKfOw3NWprnWc9iXptoNebcs/hQ0X82 hg2svyMUP01f2k777G1JRMfxB7XfTrbZD3GaYkWfJ9jqgVqW81Vzwvf215Lwu+wXyG+K8C q+3IayFFUPM7kw0E+O1w5MjxpcaAd8+dyeoTQDSTYsxs1ZjJM1WLK7iDj9rLu7idEFCqZe ENXpyXKPxsDZiOFknnJi6hWXgtzS1FW8fHji3/B3VsAzYbhM6MsSg5EoA2HgIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679321666; a=rsa-sha256; cv=none; b=OzKgxQ6PnM1CzUNipp+TiMGZjlo2q6AdrGdcgVsue7AIGQXivrTIPOawKf+tPlHL8Oh4NE SZ2T6Ipp2+B30tnpZATWV1GDjI2LY2tY/UUgRPmOWgECApDC/NdXc9wGBUMCiJO5a03eIt 0nnXqOY4IwHVNrT9K7v2YQtz9SxEVo2Gu2r2uoeTODUKher1MAYkoS9fgMl0yPgzzBPqPW ZfocZ46TBWcpyMbno7lSrrQ6KCBiyWHqTzo3xBNxZWi551OueX+pfw7tKOXp3+c8s3VVX1 bwFITJURKJuwARFrXsqpQIUr9P43odXfhdkcITD+A/8qVzs1wq4JbhvstOT3GQ== 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 4PgGvP5JXxzYQJ; Mon, 20 Mar 2023 14:14:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32KEEPAM039832; Mon, 20 Mar 2023 14:14:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32KEEP76039831; Mon, 20 Mar 2023 14:14:25 GMT (envelope-from git) Date: Mon, 20 Mar 2023 14:14:25 GMT Message-Id: <202303201414.32KEEP76039831@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: 92c5dbbb131b - main - carp tests: unicast tests (IPv4) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 92c5dbbb131bdc8d9e53555a32e9bcb2a4aa59ae Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=92c5dbbb131bdc8d9e53555a32e9bcb2a4aa59ae commit 92c5dbbb131bdc8d9e53555a32e9bcb2a4aa59ae Author: Kristof Provost AuthorDate: 2023-03-02 17:21:06 +0000 Commit: Kristof Provost CommitDate: 2023-03-20 13:37:09 +0000 carp tests: unicast tests (IPv4) Test the new unicast carp mode for IPv4. There's a routing hop between the peers, to ensure that the TTL check is correctly disabled for unicast carp. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D38941 --- tests/sys/netinet/carp.sh | 59 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/tests/sys/netinet/carp.sh b/tests/sys/netinet/carp.sh index 9afe9d2ea8c1..22f1aa3ac0e3 100755 --- a/tests/sys/netinet/carp.sh +++ b/tests/sys/netinet/carp.sh @@ -106,6 +106,64 @@ basic_v4_cleanup() vnet_cleanup } + +atf_test_case "unicast_v4" "cleanup" +unicast_v4_head() +{ + atf_set descr 'Unicast CARP test (IPv4)' + atf_set require.user root +} + +unicast_v4_body() +{ + carp_init + + bridge=$(vnet_mkbridge) + epair_one=$(vnet_mkepair) + epair_two=$(vnet_mkepair) + + vnet_mkjail carp_uni_v4_one ${bridge} ${epair_one}a ${epair_two}a + vnet_mkjail carp_uni_v4_two ${epair_one}b + vnet_mkjail carp_uni_v4_three ${epair_two}b + + jexec carp_uni_v4_one ifconfig ${bridge} 192.0.2.4/29 up + jexec carp_uni_v4_one sysctl net.inet.ip.forwarding=1 + jexec carp_uni_v4_one ifconfig ${bridge} addm ${epair_one}a \ + addm ${epair_two}a + jexec carp_uni_v4_one ifconfig ${epair_one}a up + jexec carp_uni_v4_one ifconfig ${epair_two}a up + jexec carp_uni_v4_one ifconfig ${bridge} inet alias 198.51.100.1/25 + jexec carp_uni_v4_one ifconfig ${bridge} inet alias 198.51.100.129/25 + + jexec carp_uni_v4_two ifconfig ${epair_one}b 198.51.100.2/25 up + jexec carp_uni_v4_two route add default 198.51.100.1 + jexec carp_uni_v4_two ifconfig ${epair_one}b add vhid 1 \ + peer 198.51.100.130 192.0.2.1/29 + + jexec carp_uni_v4_three ifconfig ${epair_two}b 198.51.100.130/25 up + jexec carp_uni_v4_three route add default 198.51.100.129 + jexec carp_uni_v4_three ifconfig ${epair_two}b add vhid 1 \ + peer 198.51.100.2 192.0.2.1/29 + + # Sanity check + atf_check -s exit:0 -o ignore jexec carp_uni_v4_two \ + ping -c 1 198.51.100.130 + + wait_for_carp carp_uni_v4_two ${epair_one}b \ + carp_uni_v4_three ${epair_two}b + + atf_check -s exit:0 -o ignore jexec carp_uni_v4_one \ + ping -c 3 192.0.2.1 + + jexec carp_uni_v4_two ifconfig + jexec carp_uni_v4_three ifconfig +} + +unicast_v4_cleanup() +{ + vnet_cleanup +} + atf_test_case "basic_v6" "cleanup" basic_v6_head() { @@ -290,6 +348,7 @@ switch_cleanup() atf_init_test_cases() { atf_add_test_case "basic_v4" + atf_add_test_case "unicast_v4" atf_add_test_case "basic_v6" atf_add_test_case "negative_demotion" atf_add_test_case "nd6_ns_source_mac"