From 0733afdb4dad58cfe7ad7f5994e26bf148d78199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Sun, 3 May 2026 17:35:15 +0200 Subject: [PATCH] lockf: Test that lockf does not spin on fd PR: 294832 MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D56723 --- usr.bin/lockf/tests/lockf_test.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/usr.bin/lockf/tests/lockf_test.sh b/usr.bin/lockf/tests/lockf_test.sh index 823b5673a176..16ee5a03bb9e 100644 --- a/usr.bin/lockf/tests/lockf_test.sh +++ b/usr.bin/lockf/tests/lockf_test.sh @@ -177,6 +177,23 @@ fdlock_body() atf_check test "$status2" -eq 0 } +atf_test_case fdlockspin +fdlockspin_head() +{ + atf_set "descr" "Don't spin when locking a file descriptor" +} +fdlockspin_body() +{ + # Start background locker and give it time to get settled + lockf foo sleep 2 & sleep 1 + # Start foreground locker in fdlock mode + atf_check ktrace -tc lockf -t 3 0