From nobody Sun May 3 11:03:45 2026 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 4g7hjL5plMz6cQFV for ; Sun, 03 May 2026 11:03:50 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g7hjL3x7fz3bsF for ; Sun, 03 May 2026 11:03:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777806230; 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=FKEHje/cSBruIqBHAQJ/nHis9V+OxevXNXO5DNGdjuY=; b=IjoUjEXq23K/2sUEZuLxTrDeedtMLA5CRSyvEu0ATYDguJEo5Q5XcgSj6obpji1B4xX8wH m+Qm0rni7BEWtRarRVKY0zhCFOsDuiG2oxk9TEsvIuJxfE4No5FD8Vc1N3WQ7Jok1fxpvi m6F4RWcHcEv/RG0UUtYtELHBIllbLuo/DTSe6WDUAepcgVg33mI6pbNPRfJmkAUyyno5OA cDISGIdeGRlBuqUBCeDUMizQXHHtOGT4QRRaEIwBgEal5vWKneT5urMJS8o3ihnpp8WqAn xN3lOg87zUOTHB9Un+h8FpaicxHb/6SvgANb2BcNILqYFtGeV34TAFJ/umZgHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777806230; a=rsa-sha256; cv=none; b=HzmZrAsuwG9wVn2QCLKWVEhr/1CyqWPcMojTWdE0Y+34a2xCw6Xfbb+QdhCUOCQNxw3ohd 23Sbz7soyL++QzraMf8JtMqgOA3OUBX42ce8fycGdW4YBvBdk49SfydgB7NSqRVud5remx CVwW5FaDTf7cDkSOAlaFSopcLF1S+J0vUDO0QbAsgfPGFRZ3ZH/5QhYAQyorASwKOMkt9C hMzhMkNdycbAyOKfOd9e8ckhiJxTnk39pbl0GPiAg7o2+S9dAEscio1X5LPjCHwYNo5GBR NSEcFBL4SNB38wvL5Ns9R/EvXWWoCLe+3CR3QcNNYP/1/cKVC88Ig4/Tzwxr5w== 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=1777806230; 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=FKEHje/cSBruIqBHAQJ/nHis9V+OxevXNXO5DNGdjuY=; b=ShumvYO7TDT6Fg+gvokx1hMkPwUKmLv7yqU9Y4g93kSrC2tfTCXwFdvwHNMptgQ0dANgL8 jUNdTyf1Ni80kOXkvA1b6fdsC7h3nPckEXreV4yz36UGMlKxasB9vWLJr6gWTSNbhs1dd0 xYGolPSQJ9QoZTr34IH0V80ne1pDW98K0cCGxcHeZdwrrbC/WXWYgA/QK+Plac9kq30oD3 gxoXeGd/Ua05yU7qK+EQL+YRXwf3R2VdJ2sw/ENT0eJUHLy7tGNNRdk5OhlJNiPO2jaZvq N+H4hNOAMQuyKHXFWq9Z9cTl5hpMk03+R1PFN9MRt2TE7Gb0H/jQnL6YxPmvLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g7hjL3WCkzTb9 for ; Sun, 03 May 2026 11:03:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30e95 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 03 May 2026 11:03:45 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 9137c66c2ea6 - main - tests/carp: Rework unicast_v4 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9137c66c2ea6cc09e3a6f8a042ecdc5a62e0f39e Auto-Submitted: auto-generated Date: Sun, 03 May 2026 11:03:45 +0000 Message-Id: <69f72b91.30e95.10e55bd5@gitrepo.freebsd.org> The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=9137c66c2ea6cc09e3a6f8a042ecdc5a62e0f39e commit 9137c66c2ea6cc09e3a6f8a042ecdc5a62e0f39e Author: Zhenlei Huang AuthorDate: 2026-05-03 11:02:15 +0000 Commit: Zhenlei Huang CommitDate: 2026-05-03 11:02:15 +0000 tests/carp: Rework unicast_v4 For unicast tests, it is sufficient to use wait_for_carp() to verify the setup is sane. Additional sanity checks are not necessarily required but can serve purpose for redundancy. For some unclear reason routed(8) is advertising route to carp BACKUP. That makes the test flaky. Also routed(8) is marked deprecated and may be removed from base in the future. Let's just add static route entry manually for additional sanity checks. Other noticeable changes: 1. Add atf_check to configuration steps to prevent potential failure on setup. That helps diagnosing on failure. 2. Shorten the names of jails to improve readability. 3. Prefer `[ifconfig|route|sysctl] -j` over `jexec [ifconfig|route|sysctl]` to make the lines shorter. PR: 294817 Reviewed by: glebius (previous version), pouria, markj Fixes: 93fbdef51a13 tests: carp: Update test case unicast_v4 to catch PR 284872 MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D56761 --- tests/sys/netinet/carp.sh | 80 ++++++++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 36 deletions(-) diff --git a/tests/sys/netinet/carp.sh b/tests/sys/netinet/carp.sh index e0ef2fd97583..7b484a21d8cf 100755 --- a/tests/sys/netinet/carp.sh +++ b/tests/sys/netinet/carp.sh @@ -169,58 +169,66 @@ unicast_v4_body() epair_one=$(vnet_mkepair) epair_two=$(vnet_mkepair) - vnet_mkjail carp_uni_v4_one ${epair_one}a ${epair_two}a - vnet_mkjail carp_uni_v4_two ${epair_one}b - vnet_mkjail carp_uni_v4_three ${epair_two}b + j="carp_uni_v4_" - jexec carp_uni_v4_one sysctl net.inet.ip.forwarding=1 - jexec carp_uni_v4_one ifconfig ${epair_one}a inet 198.51.100.1/25 - jexec carp_uni_v4_one ifconfig ${epair_two}a inet 198.51.100.129/25 + # The router + vnet_mkjail ${j}one ${epair_one}a ${epair_two}a + # The hosts + vnet_mkjail ${j}two ${epair_one}b + vnet_mkjail ${j}three ${epair_two}b - jexec carp_uni_v4_two sysctl net.inet.ip.forwarding=1 - jexec carp_uni_v4_two ifconfig ${epair_one}b 198.51.100.2/25 up - jexec carp_uni_v4_two route add 198.51.100.224 198.51.100.1 - # A peer address x.x.x.224 to catch PR 284872 - jexec carp_uni_v4_two ifconfig ${epair_one}b add vhid 1 \ - peer 198.51.100.224 192.0.2.1/32 + atf_check -o ignore sysctl -j ${j}one net.inet.ip.forwarding=1 + atf_check ifconfig -j ${j}one ${epair_one}a inet 198.51.100.1/25 + atf_check ifconfig -j ${j}one ${epair_two}a inet 198.51.100.129/25 - 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 - jexec carp_uni_v4_three ifconfig ${epair_two}b add vhid 1 \ - peer 198.51.100.2 192.0.2.1/32 + atf_check ifconfig -j ${j}two ${epair_one}b 198.51.100.2/25 up + atf_check -o ignore route -j ${j}two -n add default 198.51.100.1 + atf_check ifconfig -j ${j}three ${epair_two}b 198.51.100.224/25 up + atf_check -o ignore route -j ${j}three -n add default 198.51.100.129 + + sleep 0.1 # Sanity check - atf_check -s exit:0 -o ignore jexec carp_uni_v4_two \ + atf_check -o ignore jexec ${j}one \ + ping -c 1 198.51.100.2 + atf_check -o ignore jexec ${j}one \ + ping -c 1 198.51.100.224 + atf_check -o ignore jexec ${j}two \ ping -c 1 198.51.100.224 - wait_for_carp carp_uni_v4_two ${epair_one}b \ - carp_uni_v4_three ${epair_two}b + # A peer address x.x.x.224 to catch PR 284872 + atf_check ifconfig -j ${j}two ${epair_one}b add vhid 1 \ + peer 198.51.100.224 192.0.2.1/32 + sleep 0.2 + atf_check ifconfig -j ${j}three ${epair_two}b add vhid 1 \ + peer 198.51.100.2 192.0.2.1/32 - # Setup RIPv2 route daemon - jexec carp_uni_v4_two routed -s -Pripv2 - jexec carp_uni_v4_three routed -s -Pripv2 - jexec carp_uni_v4_one routed -Pripv2 + wait_for_carp ${j}two ${epair_one}b \ + ${j}three ${epair_two}b - # XXX Wait for route propagation - sleep 3 + if is_master ${j}two ${epair_one}b ; then + atf_check -o ignore \ + route -j ${j}one -n add 192.0.2.1 198.51.100.2 + fi - atf_check -s exit:0 -o ignore jexec carp_uni_v4_one \ - ping -c 3 192.0.2.1 + if is_master ${j}three ${epair_two}b ; then + atf_check -o ignore \ + route -j ${j}one -n add 192.0.2.1 198.51.100.224 + fi + + # Not necessarily required, but just in case + atf_check -o ignore jexec ${j}one \ + ping -c 1 192.0.2.1 # Check that we remain in unicast when tweaking settings - atf_check -s exit:0 -o ignore \ - jexec carp_uni_v4_two ifconfig ${epair_one}b vhid 1 advskew 2 - atf_check -s exit:0 -o match:"peer 198.51.100.224" \ - jexec carp_uni_v4_two ifconfig ${epair_one}b + atf_check -o ignore \ + ifconfig -j ${j}two ${epair_one}b vhid 1 advskew 2 + atf_check -o match:"peer 198.51.100.224" \ + ifconfig -j ${j}two ${epair_one}b } unicast_v4_cleanup() { - jexec carp_uni_v4_one killall routed - jexec carp_uni_v4_two killall routed - jexec carp_uni_v4_three killall routed vnet_cleanup }