From 4253a94b9bcb03c3c59e37a05ac006e79dfdc8bf Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 21 Feb 2026 19:39:11 +0200 Subject: Implement truncate_test.go + workload scenarios for truncate, ftruncate - truncate-basic: tests SYS_TRUNCATE (path-based) via syscall.Truncate - truncate-ftruncate: tests SYS_FTRUNCATE (fd-based) via syscall.Ftruncate - Both syscall wrappers use direct SYS_* calls on amd64 (no *at wrapping) Task #343 Amp-Thread-ID: https://ampcode.com/threads/T-019c8145-7437-7218-95ff-4cb451e18655 Co-authored-by: Amp --- integrationtests/truncate_test.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 integrationtests/truncate_test.go (limited to 'integrationtests/truncate_test.go') diff --git a/integrationtests/truncate_test.go b/integrationtests/truncate_test.go new file mode 100644 index 0000000..9b94eed --- /dev/null +++ b/integrationtests/truncate_test.go @@ -0,0 +1,25 @@ +package integrationtests + +import "testing" + +func TestTruncateBasic(t *testing.T) { + runScenario(t, "truncate-basic", []ExpectedEvent{ + { + PathContains: "truncfile.txt", + Tracepoint: "enter_truncate", + Comm: "ioworkload", + MinCount: 1, + }, + }) +} + +func TestTruncateFtruncate(t *testing.T) { + runScenario(t, "truncate-ftruncate", []ExpectedEvent{ + { + PathContains: "ftruncfile.txt", + Tracepoint: "enter_ftruncate", + Comm: "ioworkload", + MinCount: 1, + }, + }) +} -- cgit v1.2.3