summaryrefslogtreecommitdiff
path: root/integrationtests/sync_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-21 21:39:18 +0200
committerPaul Buetow <paul@buetow.org>2026-02-21 21:39:18 +0200
commitd455543bf0838c7fe2250081c5ea8ed3e275d236 (patch)
treeb34542ab4761c686d43938034c7d3960c3f0d8ba /integrationtests/sync_test.go
parent065389bac04c71a5dd5f44b2cfe5fe801bafabab (diff)
Add negative integration tests for sync syscalls (task 348)
Add three EBADF scenarios testing ior's ability to capture sync-related tracepoints even when the underlying syscall fails: - sync-fsync-ebadf: fsync on invalid fd, expects enter_fsync - sync-fdatasync-ebadf: fdatasync on invalid fd, expects enter_fdatasync - sync-file-range-ebadf: sync_file_range on invalid fd, expects enter_sync_file_range Amp-Thread-ID: https://ampcode.com/threads/T-019c81b4-216a-732c-90b1-e6771e27ed75 Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'integrationtests/sync_test.go')
-rw-r--r--integrationtests/sync_test.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/integrationtests/sync_test.go b/integrationtests/sync_test.go
index 5f6a314..763f3c2 100644
--- a/integrationtests/sync_test.go
+++ b/integrationtests/sync_test.go
@@ -44,3 +44,33 @@ func TestSyncSyncFileRange(t *testing.T) {
},
})
}
+
+func TestSyncFsyncEbadf(t *testing.T) {
+ runScenario(t, "sync-fsync-ebadf", []ExpectedEvent{
+ {
+ Tracepoint: "enter_fsync",
+ Comm: "ioworkload",
+ MinCount: 1,
+ },
+ })
+}
+
+func TestSyncFdatasyncEbadf(t *testing.T) {
+ runScenario(t, "sync-fdatasync-ebadf", []ExpectedEvent{
+ {
+ Tracepoint: "enter_fdatasync",
+ Comm: "ioworkload",
+ MinCount: 1,
+ },
+ })
+}
+
+func TestSyncFileRangeEbadf(t *testing.T) {
+ runScenario(t, "sync-file-range-ebadf", []ExpectedEvent{
+ {
+ Tracepoint: "enter_sync_file_range",
+ Comm: "ioworkload",
+ MinCount: 1,
+ },
+ })
+}