summaryrefslogtreecommitdiff
path: root/integrationtests/truncate_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-21 21:44:11 +0200
committerPaul Buetow <paul@buetow.org>2026-02-21 21:44:11 +0200
commit08cb9dfe46f843114feb42cc9ffa599717ebcc32 (patch)
treef09fdbce3bb8654bf52180ccf598173e3d8a8976 /integrationtests/truncate_test.go
parentd455543bf0838c7fe2250081c5ea8ed3e275d236 (diff)
Add negative integration tests for truncate syscalls (task 348)
Add two negative test scenarios: - truncate-enoent: SYS_TRUNCATE on nonexistent file, expects ENOENT - truncate-ftruncate-ebadf: SYS_FTRUNCATE on invalid fd 99999, expects EBADF Both verify ior captures tracepoints even when syscalls fail. Amp-Thread-ID: https://ampcode.com/threads/T-019c81b7-9641-763e-b99e-20a0d3552005 Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'integrationtests/truncate_test.go')
-rw-r--r--integrationtests/truncate_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/integrationtests/truncate_test.go b/integrationtests/truncate_test.go
index 9b94eed..7d3f12e 100644
--- a/integrationtests/truncate_test.go
+++ b/integrationtests/truncate_test.go
@@ -23,3 +23,24 @@ func TestTruncateFtruncate(t *testing.T) {
},
})
}
+
+func TestTruncateEnoent(t *testing.T) {
+ runScenario(t, "truncate-enoent", []ExpectedEvent{
+ {
+ PathContains: "truncate-enoent-missing.txt",
+ Tracepoint: "enter_truncate",
+ Comm: "ioworkload",
+ MinCount: 1,
+ },
+ })
+}
+
+func TestTruncateFtruncateEbadf(t *testing.T) {
+ runScenario(t, "truncate-ftruncate-ebadf", []ExpectedEvent{
+ {
+ Tracepoint: "enter_ftruncate",
+ Comm: "ioworkload",
+ MinCount: 1,
+ },
+ })
+}