From fa4de83302f992a94941ef904f05ce2752f6ec29 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 21 Feb 2026 19:35:12 +0200 Subject: Implement sync_test.go + workload scenarios for fsync, fdatasync, sync, sync_file_range - Add syncFdatasync, syncSync, syncSyncFileRange scenario functions - Register sync-fdatasync, sync-sync, sync-sync-file-range in scenarios map - Add sync_test.go with tests for all 4 sync-related syscalls - sync is a null_event (no path); others are fd_events - All use direct SYS_* syscalls on amd64 (no wrapper delegation) Task: #343 Amp-Thread-ID: https://ampcode.com/threads/T-019c813f-e020-7558-86ce-be6fdbd96f98 Co-authored-by: Amp --- integrationtests/sync_test.go | 46 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 integrationtests/sync_test.go (limited to 'integrationtests/sync_test.go') diff --git a/integrationtests/sync_test.go b/integrationtests/sync_test.go new file mode 100644 index 0000000..5f6a314 --- /dev/null +++ b/integrationtests/sync_test.go @@ -0,0 +1,46 @@ +package integrationtests + +import "testing" + +func TestSyncBasic(t *testing.T) { + runScenario(t, "sync-basic", []ExpectedEvent{ + { + PathContains: "syncfile.txt", + Tracepoint: "enter_fsync", + Comm: "ioworkload", + MinCount: 1, + }, + }) +} + +func TestSyncFdatasync(t *testing.T) { + runScenario(t, "sync-fdatasync", []ExpectedEvent{ + { + PathContains: "fdatasyncfile.txt", + Tracepoint: "enter_fdatasync", + Comm: "ioworkload", + MinCount: 1, + }, + }) +} + +func TestSyncSync(t *testing.T) { + runScenario(t, "sync-sync", []ExpectedEvent{ + { + Tracepoint: "enter_sync", + Comm: "ioworkload", + MinCount: 1, + }, + }) +} + +func TestSyncSyncFileRange(t *testing.T) { + runScenario(t, "sync-sync-file-range", []ExpectedEvent{ + { + PathContains: "syncrangefile.txt", + Tracepoint: "enter_sync_file_range", + Comm: "ioworkload", + MinCount: 1, + }, + }) +} -- cgit v1.2.3