From c1ced23544a0a75bf5ad331ec729ddbbbe9f2d48 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 16 Jul 2021 15:36:38 +0200 Subject: [PATCH] seccomp: use oci-spec consts in tests Signed-off-by: Sebastiaan van Stijn --- profiles/seccomp/seccomp_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/profiles/seccomp/seccomp_test.go b/profiles/seccomp/seccomp_test.go index e781141ecb..53ddfaf989 100644 --- a/profiles/seccomp/seccomp_test.go +++ b/profiles/seccomp/seccomp_test.go @@ -24,32 +24,32 @@ func TestLoadProfile(t *testing.T) { } var expectedErrno uint = 12345 expected := specs.LinuxSeccomp{ - DefaultAction: "SCMP_ACT_ERRNO", + DefaultAction: specs.ActErrno, Syscalls: []specs.LinuxSyscall{ { Names: []string{"clone"}, - Action: "SCMP_ACT_ALLOW", + Action: specs.ActAllow, Args: []specs.LinuxSeccompArg{{ Index: 0, Value: 2114060288, ValueTwo: 0, - Op: "SCMP_CMP_MASKED_EQ", + Op: specs.OpMaskedEqual, }}, }, { Names: []string{"open"}, - Action: "SCMP_ACT_ALLOW", + Action: specs.ActAllow, Args: []specs.LinuxSeccompArg{}, }, { Names: []string{"close"}, - Action: "SCMP_ACT_ALLOW", + Action: specs.ActAllow, Args: []specs.LinuxSeccompArg{}, }, { Names: []string{"syslog"}, - Action: "SCMP_ACT_ERRNO", + Action: specs.ActErrno, ErrnoRet: &expectedErrno, Args: []specs.LinuxSeccompArg{}, }, @@ -72,7 +72,7 @@ func TestLoadProfileWithDefaultErrnoRet(t *testing.T) { expectedErrnoRet := uint(6) expected := specs.LinuxSeccomp{ - DefaultAction: "SCMP_ACT_ERRNO", + DefaultAction: specs.ActErrno, DefaultErrnoRet: &expectedErrnoRet, } @@ -92,7 +92,7 @@ func TestLoadProfileWithListenerPath(t *testing.T) { } expected := specs.LinuxSeccomp{ - DefaultAction: "SCMP_ACT_ERRNO", + DefaultAction: specs.ActErrno, ListenerPath: "/var/run/seccompaget.sock", ListenerMetadata: "opaque-metadata", }