summaryrefslogtreecommitdiff
path: root/internal/generate/classify_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-19 10:12:32 +0300
committerPaul Buetow <paul@buetow.org>2026-05-19 10:12:32 +0300
commit127516b4bf63dc922df222825a9a6a1d7eacc214 (patch)
tree3839a2f6a7f4f1bc713690678fc003d4e2be8a8c /internal/generate/classify_test.go
parent32a19cf9fb1344c9b1a61054d7cf2c90edc3708a (diff)
u6: add socket/socketpair kind scaffolding and wiring
Diffstat (limited to 'internal/generate/classify_test.go')
-rw-r--r--internal/generate/classify_test.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/internal/generate/classify_test.go b/internal/generate/classify_test.go
index ea7d662..ce6eff1 100644
--- a/internal/generate/classify_test.go
+++ b/internal/generate/classify_test.go
@@ -244,10 +244,17 @@ func TestClassifyFdAccept(t *testing.T) {
}
}
-func TestClassifySocketRequiresGenerationFallback(t *testing.T) {
+func TestClassifySocket(t *testing.T) {
r := classifyFromData(t, FormatSocket)
- if r.Kind != KindNone {
- t.Errorf("socket: got kind %d, want KindNone before generation fallback", r.Kind)
+ if r.Kind != KindSocket {
+ t.Errorf("socket: got kind %d, want KindSocket", r.Kind)
+ }
+}
+
+func TestClassifySocketpair(t *testing.T) {
+ r := classifyFromData(t, FormatSocketpair)
+ if r.Kind != KindSocketpair {
+ t.Errorf("socketpair: got kind %d, want KindSocketpair", r.Kind)
}
}
@@ -288,7 +295,8 @@ func TestClassifySyscallPairAccepted(t *testing.T) {
{"mknod", FormatMknod, FormatExitMknod, KindPathname},
{"execve", FormatExecve, FormatExitExecve, KindPathname},
{"accept", FormatAccept, FormatExitAccept, KindFd},
- {"socket", FormatSocket, FormatExitSocket, KindNull},
+ {"socket", FormatSocket, FormatExitSocket, KindSocket},
+ {"socketpair", FormatSocketpair, FormatExitSocketpair, KindSocketpair},
{"kill", FormatKill, FormatExitKill, KindNull},
}
@@ -314,6 +322,7 @@ func TestClassifySyscallPairEmitsAllFamilies(t *testing.T) {
{"execve", FormatExecve, FormatExitExecve, FamilyProcess},
{"accept", FormatAccept, FormatExitAccept, FamilyNetwork},
{"socket", FormatSocket, FormatExitSocket, FamilyNetwork},
+ {"socketpair", FormatSocketpair, FormatExitSocketpair, FamilyNetwork},
{"kill", FormatKill, FormatExitKill, FamilySignals},
}