|
@@ -5,10 +5,10 @@ import (
|
|
|
"os"
|
|
|
"path"
|
|
|
"path/filepath"
|
|
|
- "syscall"
|
|
|
"testing"
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
+ "golang.org/x/sys/unix"
|
|
|
)
|
|
|
|
|
|
func TestReadProcBool(t *testing.T) {
|
|
@@ -66,9 +66,9 @@ func TestNew(t *testing.T) {
|
|
|
|
|
|
func checkSysInfo(t *testing.T, sysInfo *SysInfo) {
|
|
|
// Check if Seccomp is supported, via CONFIG_SECCOMP.then sysInfo.Seccomp must be TRUE , else FALSE
|
|
|
- if _, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_GET_SECCOMP, 0, 0); err != syscall.EINVAL {
|
|
|
+ if err := unix.Prctl(unix.PR_GET_SECCOMP, 0, 0, 0, 0); err != unix.EINVAL {
|
|
|
// Make sure the kernel has CONFIG_SECCOMP_FILTER.
|
|
|
- if _, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_SECCOMP, SeccompModeFilter, 0); err != syscall.EINVAL {
|
|
|
+ if err := unix.Prctl(unix.PR_SET_SECCOMP, unix.SECCOMP_MODE_FILTER, 0, 0, 0); err != unix.EINVAL {
|
|
|
require.True(t, sysInfo.Seccomp)
|
|
|
}
|
|
|
} else {
|