summaryrefslogtreecommitdiff
path: root/integrationtests
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-31 10:27:26 +0300
committerPaul Buetow <paul@buetow.org>2026-05-31 10:27:26 +0300
commit783c551f8e7f293b723e44386e50c4739075e2d4 (patch)
tree4e8f752123893483e1813b359e062fec426ea40f /integrationtests
parent7e58a0df8b994e4a3a53aec88dc05fe7f1b079bf (diff)
test(openat2): add end-to-end integration coverage for openat2
openat2(2) is the one open-family syscall with a structurally distinct argument layout: flags/mode live inside the open_how struct (args[2]), not as a plain int, and args[3] is the struct size. The tracer correctly reads the path from args[1] and omits flags (ev->flags = -1) rather than misreading the struct ptr/size, and registers the returned fd->path mapping via the shared handleOpenExit path. This was verified by inspection but had no integration scenario, unlike open/openat/creat/ open_by_handle_at. Add an open-openat2 ioworkload scenario issuing the raw openat2 syscall (Go has no wrapper and routes Open through openat) and a TestOpenOpenat2 integration test asserting the enter_openat2 tracepoint captures the path. Verified passing as root. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'integrationtests')
-rw-r--r--integrationtests/open_test.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/integrationtests/open_test.go b/integrationtests/open_test.go
index 98419ad..6bdb396 100644
--- a/integrationtests/open_test.go
+++ b/integrationtests/open_test.go
@@ -16,6 +16,22 @@ func TestOpenBasic(t *testing.T) {
})
}
+// TestOpenOpenat2 exercises the raw openat2(2) syscall. openat2 differs from
+// open/openat in that its flags/mode live inside an open_how struct (args[2]),
+// not a plain int; the path is still at args[1]. This test verifies ior reads
+// the path from args[1] (not the dirfd at args[0] nor the struct ptr at args[2])
+// and that the enter_openat2 tracepoint is captured end-to-end.
+func TestOpenOpenat2(t *testing.T) {
+ runScenario(t, "open-openat2", []ExpectedEvent{
+ {
+ PathContains: "openat2file.txt",
+ Tracepoint: "enter_openat2",
+ Comm: "ioworkload",
+ MinCount: 1,
+ },
+ })
+}
+
func TestOpenCreat(t *testing.T) {
runScenario(t, "open-creat", []ExpectedEvent{
{