summaryrefslogtreecommitdiff
path: root/integrationtests
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-31 09:55:02 +0300
committerPaul Buetow <paul@buetow.org>2026-05-31 09:55:02 +0300
commite8948e9f52235cbbbd8af098bc624bc20e173e6c (patch)
tree75fac81f5121cfdaac5234cca371a126be52cdb4 /integrationtests
parent75d00f479d333476990ff18f7427905bb09d49f0 (diff)
test(aio): add io_setup end-to-end integration coverage
The classic Linux AIO family (io_setup/io_submit/io_getevents/io_cancel/ io_destroy) had no integration coverage: family_test.go exercises only FS/Memory/IPC/Network/Process/Sched/Time, and iouring_test.go covers only the distinct io_uring_* family. io_setup is classified KindNull/FamilyAIO, which is correct by inspection against man 2 io_setup (nr_events is a count, ctx_idp an output pointer, so no fd/path is captured), so the tracer itself needed no change. Add an ioworkload AIO scenario that drives io_setup(2)/io_destroy(2) raw (no privileges, no libaio) plus an EINVAL variant, and integration tests that assert ior records the enter_io_setup tracepoint end-to-end, mirroring the existing iouring scenario/test pattern. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'integrationtests')
-rw-r--r--integrationtests/aio_test.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/integrationtests/aio_test.go b/integrationtests/aio_test.go
new file mode 100644
index 0000000..e41e854
--- /dev/null
+++ b/integrationtests/aio_test.go
@@ -0,0 +1,33 @@
+package integrationtests
+
+import "testing"
+
+// aioTraceArgs traces the classic Linux AIO (io_setup) family syscalls plus
+// close. io_setup/io_destroy are classified KindNull (FamilyAIO): the enter
+// event captures no fd/path (nr_events is a count, ctx_idp an output pointer)
+// and the exit event carries the raw return value.
+var aioTraceArgs = []string{"-trace-syscalls", "io_setup,io_destroy,close"}
+
+// TestAioSetup exercises io_setup(2) end-to-end and asserts ior records the
+// enter_io_setup tracepoint for the AIO family workload.
+func TestAioSetup(t *testing.T) {
+ runScenarioResultWithIorArgs(t, "aio-setup", []ExpectedEvent{
+ {
+ Tracepoint: "enter_io_setup",
+ Comm: "ioworkload",
+ MinCount: 1,
+ },
+ }, aioTraceArgs)
+}
+
+// TestAioSetupEinval drives io_setup(2) with nr_events = 0 (EINVAL). The
+// syscall fails, but ior still captures the enter_io_setup tracepoint.
+func TestAioSetupEinval(t *testing.T) {
+ runScenarioResultWithIorArgs(t, "aio-setup-einval", []ExpectedEvent{
+ {
+ Tracepoint: "enter_io_setup",
+ Comm: "ioworkload",
+ MinCount: 1,
+ },
+ }, aioTraceArgs)
+}