diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-21 21:16:01 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-21 21:16:01 +0200 |
| commit | 04500a92433396ca17cb879f4a40e4399dc06ff9 (patch) | |
| tree | 2b1de6720fb6929919dc01d32a9fcb2d025f0321 /integrationtests/rename_test.go | |
| parent | 603972340549cd3265f184457ee072fd8915e27b (diff) | |
Add negative integration tests for rename syscalls (task 348)
- rename-enoent: rename nonexistent file via SYS_RENAME (ENOENT)
- rename-noreplace: renameat2 with RENAME_NOREPLACE on existing target (EEXIST)
Both verify ior captures tracepoints on entry even when syscall fails.
Amp-Thread-ID: https://ampcode.com/threads/T-019c819e-cdae-7777-9be6-992ca8a7b96b
Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'integrationtests/rename_test.go')
| -rw-r--r-- | integrationtests/rename_test.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/integrationtests/rename_test.go b/integrationtests/rename_test.go index 0ae1d47..50d80cb 100644 --- a/integrationtests/rename_test.go +++ b/integrationtests/rename_test.go @@ -34,3 +34,25 @@ func TestRenameRenameat2(t *testing.T) { }, }) } + +func TestRenameEnoent(t *testing.T) { + runScenario(t, "rename-enoent", []ExpectedEvent{ + { + PathContains: "rename-enoent-missing.txt", + Tracepoint: "enter_rename", + Comm: "ioworkload", + MinCount: 1, + }, + }) +} + +func TestRenameNoreplace(t *testing.T) { + runScenario(t, "rename-noreplace", []ExpectedEvent{ + { + PathContains: "noreplace-dst.txt", + Tracepoint: "enter_renameat2", + Comm: "ioworkload", + MinCount: 1, + }, + }) +} |
