diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-06 10:08:54 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-06 10:08:54 +0300 |
| commit | 3ce0f52a9f608b28c550083574fa3ef442107f53 (patch) | |
| tree | d3ae33124129b7c987330db651f28565ee7ebb5b /integrationtests/stat_test.go | |
| parent | 92ca9482e44432b85ce09ebdd8a1b4d199b1c77b (diff) | |
test: add coverage for setitimer (signal-safe) and statfs/fstatfs
setitimer/getitimer (di0): no scenario previously exercised the classic
interval-timer family. Add intervalTimerNoop, which calls
setitimer(ITIMER_REAL, &{0,0,0,0}, NULL) with an all-zero itimerval so the
timer is disarmed and NO SIGALRM is ever scheduled (mirrors miscAlarmCancel's
alarm(0) and posixTimerLifecycle's never-firing pattern), followed by a safe
getitimer read. Both are KindNull on enter / UNCLASSIFIED on exit, so
TestIntervalTimerNoop asserts enter_setitimer and enter_getitimer presence.
statfs/fstatfs (7j0): stat_test.go covered stat/fstat/lstat/newfstatat/statx
but not the statfs family. Add statStatfs, which calls syscall.Statfs(path)
(enter_statfs path_event captures the pathname) and syscall.Fstatfs(fd)
(enter_fstatfs fd_event). TestStatStatfs asserts enter_statfs PathContains the
filename and enter_fstatfs presence. Covers audits it (fstatfs) and e00 (statfs).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'integrationtests/stat_test.go')
| -rw-r--r-- | integrationtests/stat_test.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/integrationtests/stat_test.go b/integrationtests/stat_test.go index 400e61a..e803b9f 100644 --- a/integrationtests/stat_test.go +++ b/integrationtests/stat_test.go @@ -101,6 +101,25 @@ func TestStatAccessEnoent(t *testing.T) { }) } +// TestStatStatfs verifies the statfs family (statfs/fstatfs) is traced +// end-to-end. enter_statfs is a path_event, so its record must contain the +// file's path; enter_fstatfs is an fd_event, asserted via enter-presence. +func TestStatStatfs(t *testing.T) { + runScenario(t, "stat-statfs", []ExpectedEvent{ + { + PathContains: "statfsfile.txt", + Tracepoint: "enter_statfs", + Comm: "ioworkload", + MinCount: 1, + }, + { + Tracepoint: "enter_fstatfs", + Comm: "ioworkload", + MinCount: 1, + }, + }) +} + func TestStatFstatEbadf(t *testing.T) { runScenario(t, "stat-fstat-ebadf", []ExpectedEvent{ { |
