summaryrefslogtreecommitdiff
path: root/internal/generate/classify_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-19 16:15:18 +0300
committerPaul Buetow <paul@buetow.org>2026-05-19 16:15:18 +0300
commit843def4f5c23db050cccfae57a9acb5899c110f4 (patch)
treed90d94c39ff59c7df7278f29f5402c58c391daec /internal/generate/classify_test.go
parent061fb2b2380752eed06a78d10567da172ea8e27c (diff)
x6: add pipe/eventfd fd-from-air syscall support
Diffstat (limited to 'internal/generate/classify_test.go')
-rw-r--r--internal/generate/classify_test.go64
1 files changed, 64 insertions, 0 deletions
diff --git a/internal/generate/classify_test.go b/internal/generate/classify_test.go
index 5c7111f..09989b8 100644
--- a/internal/generate/classify_test.go
+++ b/internal/generate/classify_test.go
@@ -313,6 +313,62 @@ func TestClassifyExitSocketpair(t *testing.T) {
}
}
+func TestClassifyPipe(t *testing.T) {
+ r := classifyFromData(t, FormatPipe)
+ if r.Kind != KindPipe {
+ t.Errorf("pipe: got kind %d, want KindPipe", r.Kind)
+ }
+}
+
+func TestClassifyPipe2(t *testing.T) {
+ r := classifyFromData(t, FormatPipe2)
+ if r.Kind != KindPipe {
+ t.Errorf("pipe2: got kind %d, want KindPipe", r.Kind)
+ }
+}
+
+func TestClassifyExitPipe(t *testing.T) {
+ r := classifyFromData(t, FormatExitPipe)
+ if r.Kind != KindPipe {
+ t.Errorf("exit_pipe: got kind %d, want KindPipe", r.Kind)
+ }
+}
+
+func TestClassifyExitPipe2(t *testing.T) {
+ r := classifyFromData(t, FormatExitPipe2)
+ if r.Kind != KindPipe {
+ t.Errorf("exit_pipe2: got kind %d, want KindPipe", r.Kind)
+ }
+}
+
+func TestClassifyEventfd(t *testing.T) {
+ r := classifyFromData(t, FormatEventfd)
+ if r.Kind != KindEventfd {
+ t.Errorf("eventfd: got kind %d, want KindEventfd", r.Kind)
+ }
+}
+
+func TestClassifyEventfd2(t *testing.T) {
+ r := classifyFromData(t, FormatEventfd2)
+ if r.Kind != KindEventfd {
+ t.Errorf("eventfd2: got kind %d, want KindEventfd", r.Kind)
+ }
+}
+
+func TestClassifyExitEventfd(t *testing.T) {
+ r := classifyFromData(t, FormatExitEventfd)
+ if r.Kind != KindEventfd {
+ t.Errorf("exit_eventfd: got kind %d, want KindEventfd", r.Kind)
+ }
+}
+
+func TestClassifyExitEventfd2(t *testing.T) {
+ r := classifyFromData(t, FormatExitEventfd2)
+ if r.Kind != KindEventfd {
+ t.Errorf("exit_eventfd2: got kind %d, want KindEventfd", r.Kind)
+ }
+}
+
func TestClassifyKillRequiresGenerationFallback(t *testing.T) {
r := classifyFromData(t, FormatKill)
if r.Kind != KindNone {
@@ -353,6 +409,10 @@ func TestClassifySyscallPairAccepted(t *testing.T) {
{"accept4", FormatAccept4, FormatExitAccept4, KindAccept},
{"socket", FormatSocket, FormatExitSocket, KindSocket},
{"socketpair", FormatSocketpair, FormatExitSocketpair, KindSocketpair},
+ {"pipe", FormatPipe, FormatExitPipe, KindPipe},
+ {"pipe2", FormatPipe2, FormatExitPipe2, KindPipe},
+ {"eventfd", FormatEventfd, FormatExitEventfd, KindEventfd},
+ {"eventfd2", FormatEventfd2, FormatExitEventfd2, KindEventfd},
{"kill", FormatKill, FormatExitKill, KindNull},
}
@@ -380,6 +440,10 @@ func TestClassifySyscallPairEmitsAllFamilies(t *testing.T) {
{"accept4", FormatAccept4, FormatExitAccept4, FamilyNetwork},
{"socket", FormatSocket, FormatExitSocket, FamilyNetwork},
{"socketpair", FormatSocketpair, FormatExitSocketpair, FamilyNetwork},
+ {"pipe", FormatPipe, FormatExitPipe, FamilyIPC},
+ {"pipe2", FormatPipe2, FormatExitPipe2, FamilyIPC},
+ {"eventfd", FormatEventfd, FormatExitEventfd, FamilyIPC},
+ {"eventfd2", FormatEventfd2, FormatExitEventfd2, FamilyIPC},
{"kill", FormatKill, FormatExitKill, FamilySignals},
}