From e8948e9f52235cbbbd8af098bc624bc20e173e6c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 31 May 2026 09:55:02 +0300 Subject: 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 --- integrationtests/aio_test.go | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 integrationtests/aio_test.go (limited to 'integrationtests/aio_test.go') 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) +} -- cgit v1.2.3