All checks were successful
Test / Create distribution (push) Successful in 33s
Test / Sandbox (push) Successful in 2m12s
Test / Hakurei (push) Successful in 3m16s
Test / Hpkg (push) Successful in 4m5s
Test / Sandbox (race detector) (push) Successful in 4m8s
Test / Hakurei (race detector) (push) Successful in 5m3s
Test / Flake checks (push) Successful in 1m28s
This enables the test to refer to this type and check its size. Signed-off-by: Ophestra <cat@gensokyo.uk>
32 lines
624 B
Go
32 lines
624 B
Go
package seccomp
|
|
|
|
import (
|
|
"testing"
|
|
"unsafe"
|
|
|
|
"hakurei.app/container/std"
|
|
)
|
|
|
|
func TestSyscallResolveName(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
for name, want := range std.Syscalls() {
|
|
t.Run(name, func(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
// this checks the std implementation against libseccomp.
|
|
if got, ok := syscallResolveName(name); !ok || got != want {
|
|
t.Errorf("syscallResolveName(%q) = %d, want %d", name, got, want)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
func TestRuleSize(t *testing.T) {
|
|
got := unsafe.Sizeof(NativeRule{})
|
|
want := unsafe.Sizeof(syscallRule{})
|
|
if got != want {
|
|
t.Fatalf("NativeRule: %d, want %d", got, want)
|
|
}
|
|
}
|