git: a5dc51aa5f29 - main - tests/truss: xfail accepted ABIs test if linux(4) not implemented

From: Siva Mahadevan <siva_at_FreeBSD.org>
Date: Mon, 14 Sep 2026 16:58:19 UTC
The branch main has been updated by siva:

URL: https://cgit.FreeBSD.org/src/commit/?id=a5dc51aa5f292de732939ef24c757a17dee0ad06

commit a5dc51aa5f292de732939ef24c757a17dee0ad06
Author:     Siva Mahadevan <siva@FreeBSD.org>
AuthorDate: 2026-09-14 16:55:56 +0000
Commit:     Siva Mahadevan <siva@FreeBSD.org>
CommitDate: 2026-09-14 16:57:57 +0000

    tests/truss: xfail accepted ABIs test if linux(4) not implemented
    
    Split accepted ABIs test into separate case and conditionally
    xfail it on archs that don't have linux(4) support.
    
    This fixes a CI test failure[0].
    
    [0] https://ci.freebsd.org/job/FreeBSD-main-riscv64-test/16706/testReport/usr.bin.truss/truss_test/unknown_syscall/
    
    Reviewed by:    dteske
    MFC after:      3 days
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D59594
---
 usr.bin/truss/tests/truss_test.sh | 36 ++++++++++++++++++++++++++++++------
 1 file changed, 30 insertions(+), 6 deletions(-)

diff --git a/usr.bin/truss/tests/truss_test.sh b/usr.bin/truss/tests/truss_test.sh
index eb331e21c0f3..967897789a29 100644
--- a/usr.bin/truss/tests/truss_test.sh
+++ b/usr.bin/truss/tests/truss_test.sh
@@ -209,18 +209,41 @@ unknown_syscall_body()
 	    -e match:'matches no known system call' \
 	    truss -o out2 -t 'raed*' cat input
 
+	# A number is the way to name a system call by number; '#' is not
+	# a prefix truss accepts, so it is diagnosed like any other typo.
+	atf_check -s exit:0 -o inline:"hello\n" \
+	    -e match:'matches no known system call' \
+	    truss -o out4 -t '#237' cat input
+}
+
+atf_test_case accepted_abis
+accepted_abis_head()
+{
+	atf_set descr "all ABIs known to truss are accepted by -t filter"
+}
+accepted_abis_body()
+{
+	require_truss
+	printf 'hello\n' > input
+
 	# Names of every ABI truss knows are accepted without complaint,
 	# whether or not that ABI is the one being traced here.
-	for name in read openat linux_write linux_newstat compat11.stat; do
+	for name in read openat compat11.stat; do
 		atf_check -s exit:0 -o inline:"hello\n" -e empty \
 		    truss -o out3 -t "$name" cat input
 	done
 
-	# A number is the way to name a system call by number; '#' is not
-	# a prefix truss accepts, so it is diagnosed like any other typo.
-	atf_check -s exit:0 -o inline:"hello\n" \
-	    -e match:'matches no known system call' \
-	    truss -o out4 -t '#237' cat input
+	# sysdecode(3) has Linux names only on amd64, i386, and aarch64
+	arch="$(uname -p)"
+	case "$arch" in
+		i386|amd64|aarch64) ;;
+		*) atf_expect_fail "linux(4) support not available on $arch" ;;
+	esac
+
+	for name in linux_write linux_newstat; do
+		atf_check -s exit:0 -o inline:"hello\n" -e empty \
+		    truss -o out3 -t "$name" cat input
+	done
 }
 
 atf_test_case by_name
@@ -391,6 +414,7 @@ atf_init_test_cases()
 	atf_add_test_case by_number
 	atf_add_test_case bad_number
 	atf_add_test_case unknown_syscall
+	atf_add_test_case accepted_abis
 	atf_add_test_case by_name
 	atf_add_test_case by_pattern
 	atf_add_test_case group