diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-21 13:59:39 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-21 13:59:39 +0200 |
| commit | b5792f8e23d1599dcce49bc83e5d128abee484f3 (patch) | |
| tree | ef07039e4e05b23a6b41adf6b663abd0109a436b /internal/generate/classify_test.go | |
| parent | 114f0cb9e6e5487fccaafb7d7065b611c8c14402 (diff) | |
Enable name_to_handle_at and io_uring fd attribution
Amp-Thread-ID: https://ampcode.com/threads/T-019c7fec-eec9-706a-8338-3ce674802680
Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'internal/generate/classify_test.go')
| -rw-r--r-- | internal/generate/classify_test.go | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/internal/generate/classify_test.go b/internal/generate/classify_test.go index c94e359..950e056 100644 --- a/internal/generate/classify_test.go +++ b/internal/generate/classify_test.go @@ -136,6 +136,16 @@ func TestClassifyOpenByHandleAt(t *testing.T) { } } +func TestClassifyNameToHandleAt(t *testing.T) { + r := classifyFromData(t, FormatNameToHandleAt) + if r.Kind != KindPathname { + t.Errorf("name_to_handle_at: got kind %d, want KindPathname", r.Kind) + } + if r.PathnameField != "name" { + t.Errorf("name_to_handle_at: PathnameField = %q, want name", r.PathnameField) + } +} + func TestClassifyNullSync(t *testing.T) { r := classifyFromData(t, FormatSync) if r.Kind != KindNull { @@ -152,8 +162,15 @@ func TestClassifyNullSyslog(t *testing.T) { func TestClassifyNullIoUring(t *testing.T) { r := classifyFromData(t, FormatIoUringEnter) - if r.Kind != KindNull { - t.Errorf("io_uring_enter: got kind %d, want KindNull", r.Kind) + if r.Kind != KindFd { + t.Errorf("io_uring_enter: got kind %d, want KindFd", r.Kind) + } +} + +func TestClassifyIoUringRegister(t *testing.T) { + r := classifyFromData(t, FormatIoUringRegister) + if r.Kind != KindFd { + t.Errorf("io_uring_register: got kind %d, want KindFd", r.Kind) } } @@ -282,7 +299,9 @@ func TestClassifySyscallPairAccepted(t *testing.T) { {"sync", FormatSync, FormatExitSync, KindNull}, {"syslog", FormatSyslog, FormatExitSyslog, KindNull}, {"open_by_handle_at", FormatOpenByHandleAt, FormatExitOpenByHandleAt, KindOpenByHandleAt}, - {"io_uring_enter", FormatIoUringEnter, FormatExitIoUringEnter, KindNull}, + {"name_to_handle_at", FormatNameToHandleAt, FormatExitNameToHandleAt, KindPathname}, + {"io_uring_enter", FormatIoUringEnter, FormatExitIoUringEnter, KindFd}, + {"io_uring_register", FormatIoUringRegister, FormatExitIoUringRegister, KindFd}, {"pread64", FormatPread64, FormatExitPread64, KindFd}, {"symlink", FormatSymlink, FormatExitSymlink, KindName}, } |
