diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-21 21:12:12 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-21 21:12:12 +0200 |
| commit | 603972340549cd3265f184457ee072fd8915e27b (patch) | |
| tree | 130bddd56929ddf6bd517375a3c1e57b983271ba /integrationtests/fcntl_test.go | |
| parent | 70ccf3c69fec44833b15d93be754f1fadd25614c (diff) | |
Add negative integration tests for fcntl syscalls (task 348)
Add two negative scenarios:
- fcntl-invalid-fd: calls SYS_FCNTL F_GETFL on invalid fd 99999 (EBADF)
- fcntl-dupfd-max: calls F_DUPFD with minfd=1<<30 beyond RLIMIT_NOFILE (EINVAL)
Both verify ior captures enter_fcntl tracepoints even when syscalls fail.
Amp-Thread-ID: https://ampcode.com/threads/T-019c819b-5673-75ab-8eb4-227b6cf56b38
Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'integrationtests/fcntl_test.go')
| -rw-r--r-- | integrationtests/fcntl_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/integrationtests/fcntl_test.go b/integrationtests/fcntl_test.go index f9c95bd..5062bd6 100644 --- a/integrationtests/fcntl_test.go +++ b/integrationtests/fcntl_test.go @@ -34,3 +34,24 @@ func TestFcntlDupfdCloexec(t *testing.T) { }, }) } + +func TestFcntlInvalidFd(t *testing.T) { + runScenario(t, "fcntl-invalid-fd", []ExpectedEvent{ + { + Tracepoint: "enter_fcntl", + Comm: "ioworkload", + MinCount: 1, + }, + }) +} + +func TestFcntlDupfdMax(t *testing.T) { + runScenario(t, "fcntl-dupfd-max", []ExpectedEvent{ + { + PathContains: "fcntldupfdmaxfile.txt", + Tracepoint: "enter_fcntl", + Comm: "ioworkload", + MinCount: 1, + }, + }) +} |
