From nobody Sun Apr 6 22:51:17 2025 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 4ZW6yZ1nc0z5s8X0; Sun, 06 Apr 2025 22:51:18 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZW6yY5jWFz3KT4; Sun, 06 Apr 2025 22:51:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1743979877; 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=ElnyeMBsa297FU/n2bKBrVIVp7UYqXu3HlJN5293GdM=; b=EGx1P6OIvwwWajd6mXxbxojiFUZig2CbYkdi3gGF6FzOjj8vW7RP4h1eOiAmsnTkcJ71+T KE9p8wNQfcIlqxbW9Wy3TLhnkh2ya+FRnkQFSUpOPANaUQjO/qrzuN3ArxJ6CaK6l5nc6M HXSNCzyKXyODvlMLLUxxqx+iNNFa5rWVP5JrP4g/UxAehRl10wfCTooUHwMLFhnE7d9dBi m8H8hfl3rYqqI1HNzn+YohMU9XX/MikKYBsYM98kMR2PYx8SqP0RTB7vvGatVNWSD2+oyF xhxcI10TZO50j67deh9wPKIfm9PuNW470tCIDWJ9ORTU30hO3lPYHHobFPoVAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1743979877; a=rsa-sha256; cv=none; b=xTZ2g4v25/OMzoIoHggrVn1Wy7TKn+Q4Dk6ue0qNeU4rgN07UylGgqlU0J5dG1zd33sKpm S0RaGpLnF7wwE7kUGIRxg03eWUOOUxk7kGZqUDGsDKkT8xqvhaSGpHHD6ADTBK2r/B6K0f BRX9i7ep/LQUlacADZT+wFcpo1LNCLECxpE3dWJ3pKf3Ir/qV/Pxss7fAoGSC5tRcaSrtJ 5L/9C0KB7bqTnq1HC97PaWTRRzYUuSLXcjPvOwd2xqfms5NAaFJknxhXF1f3eDFP779J3Z MSgHjRfFre2xZpzGYWo+s07wfSON4vja4VP33AtpnWJbN7bE2eZsqv7hjbnB3A== 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=1743979877; 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=ElnyeMBsa297FU/n2bKBrVIVp7UYqXu3HlJN5293GdM=; b=lgj8doD8kj+Zvo4a6nMaUs8HxIdcSAoAyq6TWNkb/0M4xRfrdFaX0EH3oMVpyyDCxdA+Jc 5920jEHiJz7TKa6t6LWSafUdgLXNbRBTqmoZjbfZ6FzFDZGXt0VxUaRzQPUFUpug8ocUvx m8mvk2YpVlu//T5oKahAdj85xgTgUD1qUEs+/5EtvRDZ1vQ8UNAWz/j6tgqbSP6FddppH7 aiersGRiRhGXvAd8Tq7wGDzTVZGh4+NX2tJcwPwURGEpcduewBrIBPnT70mI7VHO41Aon0 bverH+J9giCn/Go5yLLupEJAQQco3QYho9nt6MBJEvnUBzWVaP8qX4FA9vQxbw== 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 4ZW6yY4mTpz5lS; Sun, 06 Apr 2025 22:51:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 536MpHgl077288; Sun, 6 Apr 2025 22:51:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 536MpHRn077285; Sun, 6 Apr 2025 22:51:17 GMT (envelope-from git) Date: Sun, 6 Apr 2025 22:51:17 GMT Message-Id: <202504062251.536MpHRn077285@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: ba224cec6796 - stable/14 - fibs tests: Fix test failures and simplify 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: ba224cec67961cedf7531bd6942a342db4a98b3c Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ba224cec67961cedf7531bd6942a342db4a98b3c commit ba224cec67961cedf7531bd6942a342db4a98b3c Author: Mark Johnston AuthorDate: 2025-01-21 21:44:25 +0000 Commit: Mark Johnston CommitDate: 2025-04-06 18:08:18 +0000 fibs tests: Fix test failures and simplify The tests previously expected the invoker to pass a list of FIBs to use. However, they now run in separate VNET jails, so we can simply expand the FIB array as needed in each test. Modify each test to simply set net.fibs as needed and grab FIB numbers starting at 1. A number of tests were also broken by commit 9206c7996198 ("usr.bin/netstat: -n should not print symbolic names"), so fix those. Reviewed by: asomers Fixes: 9206c7996198 ("usr.bin/netstat: -n should not print symbolic names") MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D48585 (cherry picked from commit 81b076e43aa63ac255996093233ab3560a23977e) Note, the netstat-related changes described above are not merged. --- tests/sys/netinet/fibs_test.sh | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/tests/sys/netinet/fibs_test.sh b/tests/sys/netinet/fibs_test.sh index 5c1a918abb2c..b58a45b26f3e 100644 --- a/tests/sys/netinet/fibs_test.sh +++ b/tests/sys/netinet/fibs_test.sh @@ -30,9 +30,6 @@ # Authors: Alan Somers (Spectra Logic Corporation) # -# All of the tests in this file requires the test-suite config variable "fibs" -# to be defined to a space-delimited list of FIBs that may be used for testing. - # arpresolve should check the interface fib for routes to a target when # creating an ARP table entry. This is a regression for kern/167947, where # arpresolve only checked the default route. @@ -48,7 +45,6 @@ arpresolve_checks_interface_fib_head() { atf_set "descr" "arpresolve should check the interface fib, not the default fib, for routes" atf_set "require.user" "root" - atf_set "require.config" "fibs" atf_set "require.progs" "nping" } arpresolve_checks_interface_fib_body() @@ -100,7 +96,6 @@ loopback_and_network_routes_on_nondefault_fib_head() { atf_set "descr" "When creating and deleting loopback IPv4 routes, use the interface's fib" atf_set "require.user" "root" - atf_set "require.config" "fibs" } loopback_and_network_routes_on_nondefault_fib_body() @@ -157,7 +152,6 @@ loopback_and_network_routes_on_nondefault_fib_inet6_head() { atf_set "descr" "When creating and deleting loopback IPv6 routes, use the interface's fib" atf_set "require.user" "root" - atf_set "require.config" "fibs" } loopback_and_network_routes_on_nondefault_fib_inet6_body() @@ -216,7 +210,6 @@ default_route_with_multiple_fibs_on_same_subnet_head() { atf_set "descr" "Multiple interfaces on the same subnet but with different fibs can both have default IPv4 routes" atf_set "require.user" "root" - atf_set "require.config" "fibs" } default_route_with_multiple_fibs_on_same_subnet_body() @@ -263,7 +256,6 @@ default_route_with_multiple_fibs_on_same_subnet_inet6_head() { atf_set "descr" "Multiple interfaces on the same subnet but with different fibs can both have default IPv6 routes" atf_set "require.user" "root" - atf_set "require.config" "fibs" } default_route_with_multiple_fibs_on_same_subnet_inet6_body() @@ -315,7 +307,6 @@ same_ip_multiple_ifaces_fib0_head() { atf_set "descr" "Can remove an IPv4 alias from an interface when the same IPv4 is also assigned to another interface." atf_set "require.user" "root" - atf_set "require.config" "fibs" } same_ip_multiple_ifaces_fib0_body() { @@ -358,7 +349,6 @@ same_ip_multiple_ifaces_head() { atf_set "descr" "Can remove an IPv4 alias from an interface when the same address is also assigned to another interface, on non-default FIBs." atf_set "require.user" "root" - atf_set "require.config" "fibs" } same_ip_multiple_ifaces_body() { @@ -404,7 +394,6 @@ same_ip_multiple_ifaces_inet6_head() { atf_set "descr" "Can remove an IPv6 alias from an interface when the same address is also assigned to another interface, on non-default FIBs." atf_set "require.user" "root" - atf_set "require.config" "fibs" } same_ip_multiple_ifaces_inet6_body() { @@ -446,7 +435,7 @@ slaac_on_nondefault_fib6_head() { atf_set "descr" "SLAAC correctly installs routes on non-default FIBs" atf_set "require.user" "root" - atf_set "require.config" "fibs" "allow_sysctl_side_effects" + atf_set "require.config" "allow_sysctl_side_effects" } slaac_on_nondefault_fib6_body() { @@ -533,7 +522,6 @@ subnet_route_with_multiple_fibs_on_same_subnet_head() { atf_set "descr" "Multiple FIBs can have IPv4 subnet routes for the same subnet" atf_set "require.user" "root" - atf_set "require.config" "fibs" } subnet_route_with_multiple_fibs_on_same_subnet_body() @@ -570,7 +558,6 @@ subnet_route_with_multiple_fibs_on_same_subnet_inet6_head() { atf_set "descr" "Multiple FIBs can have IPv6 subnet routes for the same subnet" atf_set "require.user" "root" - atf_set "require.config" "fibs" } subnet_route_with_multiple_fibs_on_same_subnet_inet6_body() @@ -620,7 +607,6 @@ udp_dontroute_head() { atf_set "descr" "Source address selection for UDP packets with SO_DONTROUTE on non-default FIBs works" atf_set "require.user" "root" - atf_set "require.config" "fibs" } udp_dontroute_body() @@ -671,7 +657,6 @@ udp_dontroute6_head() { atf_set "descr" "Source address selection for UDP IPv6 packets with SO_DONTROUTE on non-default FIBs works" atf_set "require.user" "root" - atf_set "require.config" "fibs" } udp_dontroute6_body() @@ -748,15 +733,13 @@ get_fibs() { NUMFIBS=$1 net_fibs=`sysctl -n net.fibs` + if [ $net_fibs -lt $(($NUMFIBS + 1)) ]; then + atf_check -o ignore sysctl net.fibs=$(($NUMFIBS + 1)) + net_fibs=`sysctl -n net.fibs` + fi i=0 while [ $i -lt "$NUMFIBS" ]; do - fib=`atf_config_get "fibs" | \ - awk -v i=$(( i + 1 )) '{print $i}'` - echo "fib is ${fib}" - eval FIB${i}=${fib} - if [ "$fib" -ge "$net_fibs" ]; then - atf_skip "The ${i}th configured fib is ${fib}, which is not less than net.fibs, which is ${net_fibs}" - fi + eval FIB${i}=$(($i + 1)) i=$(( $i + 1 )) done } @@ -816,9 +799,7 @@ setup_iface() local ADDR=$4 local MASK=$5 local FLAGS=$6 - echo setfib ${FIB} \ - ifconfig $IFACE ${PROTO} ${ADDR}/${MASK} fib $FIB $FLAGS - setfib ${FIB} ifconfig $IFACE ${PROTO} ${ADDR}/${MASK} fib $FIB $FLAGS + atf_check setfib ${FIB} ifconfig $IFACE ${PROTO} ${ADDR}/${MASK} fib $FIB $FLAGS } # Create a tap(4) interface, configure it, and register it for cleanup.