From fba201c9953a490da914b09e09eaaa697a4b36e1 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Wed, 5 Nov 2025 06:00:39 +0900 Subject: container/std: relocate rule types This enables its use in hst for #15. Signed-off-by: Ophestra --- container/init_test.go | 86 +++++++++++++++++++++++++------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) (limited to 'container/init_test.go') diff --git a/container/init_test.go b/container/init_test.go index ae037210..7ab4c917 100644 --- a/container/init_test.go +++ b/container/init_test.go @@ -69,7 +69,7 @@ func TestInitEntrypoint(t *testing.T) { Uid: 1 << 32, Gid: 1 << 31, Hostname: "hakurei-check", - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -94,7 +94,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: (*Ops)(sliceAddr(make(Ops, 1))), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -122,7 +122,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: (*Ops)(sliceAddr(make(Ops, 1))), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -151,7 +151,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: (*Ops)(sliceAddr(make(Ops, 1))), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -181,7 +181,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: (*Ops)(sliceAddr(make(Ops, 1))), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -212,7 +212,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: (*Ops)(sliceAddr(make(Ops, 1))), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -244,7 +244,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: (*Ops)(sliceAddr(make(Ops, 1))), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -278,7 +278,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: (*Ops)(sliceAddr(make(Ops, 1))), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -314,7 +314,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: (*Ops)(sliceAddr(make(Ops, 1))), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -352,7 +352,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(nil, nil, std.BindDevice), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -390,7 +390,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -429,7 +429,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -468,7 +468,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -508,7 +508,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -549,7 +549,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -591,7 +591,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -634,7 +634,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -678,7 +678,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -723,7 +723,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -769,7 +769,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -824,7 +824,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -879,7 +879,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -935,7 +935,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -992,7 +992,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -1051,7 +1051,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -1111,7 +1111,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -1172,7 +1172,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -1234,7 +1234,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -1297,7 +1297,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -1361,7 +1361,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -1426,7 +1426,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -1492,7 +1492,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -1566,7 +1566,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -1673,7 +1673,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -1781,7 +1781,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, @@ -1891,7 +1891,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 47, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompDisable: true, ParentPerm: 0750, }, 1971, 127, 2, false}, uintptr(0x39)}, stub.UniqueError(13), nil), @@ -2005,7 +2005,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 47, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompDisable: true, ParentPerm: 0750, }, 1971, 127, 2, false}, uintptr(0x39)}, stub.UniqueError(10), nil), @@ -2103,7 +2103,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 47, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompDisable: true, ParentPerm: 0750, }, 1971, 127, 2, false}, uintptr(0x39)}, stub.UniqueError(7), nil), @@ -2201,7 +2201,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 47, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompDisable: true, ParentPerm: 0750, }, 1971, 127, 2, false}, uintptr(0x39)}, stub.UniqueError(7), nil), @@ -2292,7 +2292,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 47, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompDisable: true, ParentPerm: 0750, }, 1971, 127, 2, false}, uintptr(0x39)}, stub.UniqueError(5), nil), @@ -2385,7 +2385,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 47, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompDisable: true, ParentPerm: 0750, }, 1971, 127, 2, false}, uintptr(0x39)}, stub.UniqueError(3), nil), @@ -2485,7 +2485,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 47, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompDisable: true, ParentPerm: 0750, }, 1971, 127, 2, false}, uintptr(0x39)}, stub.UniqueError(1), nil), @@ -2621,7 +2621,7 @@ func TestInitEntrypoint(t *testing.T) { Gid: 1 << 31, Hostname: "hakurei-check", Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")), - SeccompRules: make([]seccomp.NativeRule, 0), + SeccompRules: make([]std.NativeRule, 0), SeccompPresets: std.PresetStrict, RetainSession: true, Privileged: true, -- cgit v1.3.1