summaryrefslogtreecommitdiff
path: root/integrationtests/dir_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-21 21:31:16 +0200
committerPaul Buetow <paul@buetow.org>2026-02-21 21:31:16 +0200
commitc36cb85503ce96a589a2dd38c1279b31c87164f2 (patch)
tree8bf8390aff6c48d996b13fbdb3ca5d55cbbe7547 /integrationtests/dir_test.go
parentb443f001cce8662a7fdccd4e0e7f707f7b2b47b8 (diff)
Add negative integration tests for dir syscalls (task 348)
Add three negative test scenarios for directory operations: - dir-mkdir-eexist: SYS_MKDIR on existing directory (EEXIST) - dir-chdir-enoent: SYS_CHDIR to nonexistent directory (ENOENT) - dir-getdents-ebadf: SYS_GETDENTS64 with invalid fd (EBADF) All use raw syscalls to hit exact tracepoints. Tests verify ior captures events even when syscalls fail (entry-side capture). Amp-Thread-ID: https://ampcode.com/threads/T-019c81ab-0d62-726e-b859-91b4898be6fe Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'integrationtests/dir_test.go')
-rw-r--r--integrationtests/dir_test.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/integrationtests/dir_test.go b/integrationtests/dir_test.go
index 67bbe93..585f03f 100644
--- a/integrationtests/dir_test.go
+++ b/integrationtests/dir_test.go
@@ -45,3 +45,35 @@ func TestDirGetdents(t *testing.T) {
},
})
}
+
+func TestDirMkdirEexist(t *testing.T) {
+ runScenario(t, "dir-mkdir-eexist", []ExpectedEvent{
+ {
+ PathContains: "mkdir-eexist-subdir",
+ Tracepoint: "enter_mkdir",
+ Comm: "ioworkload",
+ MinCount: 2,
+ },
+ })
+}
+
+func TestDirChdirEnoent(t *testing.T) {
+ runScenario(t, "dir-chdir-enoent", []ExpectedEvent{
+ {
+ PathContains: "chdir-enoent-missing",
+ Tracepoint: "enter_chdir",
+ Comm: "ioworkload",
+ MinCount: 1,
+ },
+ })
+}
+
+func TestDirGetdentsEbadf(t *testing.T) {
+ runScenario(t, "dir-getdents-ebadf", []ExpectedEvent{
+ {
+ Tracepoint: "enter_getdents64",
+ Comm: "ioworkload",
+ MinCount: 1,
+ },
+ })
+}