diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-06 09:22:15 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-06 09:22:15 +0300 |
| commit | 178ca1f256b1e345cad2f506b6b244fb50d8d281 (patch) | |
| tree | b0d44ee4b4052df12177ea69a8f7d8ae1f6d8034 /integrationtests | |
| parent | 322496c2863d5bc14b0a5e4af16690bf19073cae (diff) | |
test(timerfd): assert timerfd_settime/gettime fd capture end-to-end
The fd-from-air-eventfd-users workload only called timerfd_create then
closed the fd, so timerfd_settime/timerfd_gettime were never exercised
by any integration test. Commit 6ac9fa4 fixed those two syscalls to
KindFd@arg0 (capturing the operating timerfd via fd_event instead of a
null_event), but that fix had no end-to-end coverage.
Extend the workload to arm the still-open timerfd via timerfd_settime
(1s relative expiry, so it never fires) and read it back via
timerfd_gettime before closing. Assert in TestFdFromAirEventfdUsers that
both enter handlers fire (MinCount>=1) and resolve to the "timerfd:"
path prefix, proving arg0 fd is captured rather than null. Locks in the
6ac9fa4 KindFd fix.
splice/tee are NOT touched: retbytes_test.go already asserts
enter_splice/enter_tee plus positive transfer byte counts, which
inherently exercises their arg0 fd capture, so no new coverage is
needed there.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'integrationtests')
| -rw-r--r-- | integrationtests/ipc_test.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/integrationtests/ipc_test.go b/integrationtests/ipc_test.go index 8420b9b..ea51ccc 100644 --- a/integrationtests/ipc_test.go +++ b/integrationtests/ipc_test.go @@ -73,10 +73,20 @@ func TestFdFromAirEventfdUsers(t *testing.T) { {Tracepoint: "enter_signalfd", MinCount: 1}, {Tracepoint: "enter_signalfd4", MinCount: 1}, {Tracepoint: "enter_timerfd_create", MinCount: 1}, + // The timerfd is armed and read back while still open, so + // timerfd_settime/gettime fire against the existing descriptor. + {Tracepoint: "enter_timerfd_settime", MinCount: 1}, + {Tracepoint: "enter_timerfd_gettime", MinCount: 1}, }) assertTracepointPathPrefix(t, result, "enter_memfd_create", "memfd:") assertTracepointPathPrefix(t, result, "enter_timerfd_create", "timerfd:") + + // timerfd_settime/gettime take the timerfd as arg0 (kind=fd@arg0). The + // "timerfd:" path prefix proves the enter handlers captured that fd via + // fd_event rather than emitting a null event, locking in the 6ac9fa4 fix. + assertTracepointPathPrefix(t, result, "enter_timerfd_settime", "timerfd:") + assertTracepointPathPrefix(t, result, "enter_timerfd_gettime", "timerfd:") } // TestInotifyBasic asserts end-to-end tracing of the inotify IPC family. |
