aboutsummaryrefslogtreecommitdiffhomepage
path: root/sandbox/seccomp/syscall_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-07-01 00:35:27 +0900
committerOphestra <cat@gensokyo.uk>2025-07-01 00:35:27 +0900
commite03d702d088ad78645d1cce448713ef71b12e803 (patch)
treed7ccb51bb009a8a22dfc17ebc79b499d25dbe7ac /sandbox/seccomp/syscall_test.go
parent241dc964a6bb2116cd95a78dbbc35f9792dad554 (diff)
sandbox/seccomp: implement syscall lookup
This uses the Go map and is verified against libseccomp. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'sandbox/seccomp/syscall_test.go')
-rw-r--r--sandbox/seccomp/syscall_test.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/sandbox/seccomp/syscall_test.go b/sandbox/seccomp/syscall_test.go
index 81f470aa..933f060b 100644
--- a/sandbox/seccomp/syscall_test.go
+++ b/sandbox/seccomp/syscall_test.go
@@ -5,12 +5,16 @@ import (
)
func TestSyscallResolveName(t *testing.T) {
- for name, want := range syscallNum {
+ for name, want := range Syscalls() {
t.Run(name, func(t *testing.T) {
if got := syscallResolveName(name); got != want {
t.Errorf("syscallResolveName(%q) = %d, want %d",
name, got, want)
}
+ if got, ok := SyscallResolveName(name); !ok || got != want {
+ t.Errorf("SyscallResolveName(%q) = %d, want %d",
+ name, got, want)
+ }
})
}
}