aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/spcontainer_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-10-14 06:37:24 +0900
committerOphestra <cat@gensokyo.uk>2025-10-14 06:39:00 +0900
commit4c647add0db06cc7a28571aee7502737f0d66b27 (patch)
tree7446453d4380ed21c3ad3c3f8026c708fc53e729 /internal/app/spcontainer_test.go
parenta3414669428d4de37b68aff3f2db14e5768e1f59 (diff)
hst/container: pack boolean options
The memory saving is relatively insignificant, however this increases serialisation efficiency. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/spcontainer_test.go')
-rw-r--r--internal/app/spcontainer_test.go19
1 files changed, 7 insertions, 12 deletions
diff --git a/internal/app/spcontainer_test.go b/internal/app/spcontainer_test.go
index 6d5713cf..458588af 100644
--- a/internal/app/spcontainer_test.go
+++ b/internal/app/spcontainer_test.go
@@ -51,12 +51,7 @@ func TestSpParamsOp(t *testing.T) {
}, func() *hst.Config {
c := hst.Template()
c.Container.Args = nil
- c.Container.Multiarch = false
- c.Container.SeccompCompat = false
- c.Container.Devel = false
- c.Container.Userns = false
- c.Container.Tty = false
- c.Container.Device = false
+ c.Container.Flags = hst.FHostNet | hst.FHostAbstract | hst.FMapRealUID
return c
}, nil, []stub.Call{
call("lookupEnv", stub.ExpectArgs{"TERM"}, "xterm", nil),
@@ -65,8 +60,8 @@ func TestSpParamsOp(t *testing.T) {
// this op configures the container state and does not make calls during toContainer
}, &container.Params{
Hostname: config.Container.Hostname,
- HostNet: config.Container.HostNet,
- HostAbstract: config.Container.HostAbstract,
+ HostNet: true,
+ HostAbstract: true,
Path: config.Container.Path,
Args: []string{config.Container.Path.String()},
SeccompPresets: bits.PresetExt | bits.PresetDenyDevel | bits.PresetDenyNS | bits.PresetDenyTTY,
@@ -109,9 +104,9 @@ func TestSpParamsOp(t *testing.T) {
// this op configures the container state and does not make calls during toContainer
}, &container.Params{
Hostname: config.Container.Hostname,
- RetainSession: config.Container.Tty,
- HostNet: config.Container.HostNet,
- HostAbstract: config.Container.HostAbstract,
+ RetainSession: true,
+ HostNet: true,
+ HostAbstract: true,
Path: config.Container.Path,
Args: config.Container.Args,
SeccompFlags: seccomp.AllowMultiarch,
@@ -159,7 +154,7 @@ func TestSpFilesystemOp(t *testing.T) {
}}},
{FilesystemConfig: &hst.FSEphemeral{Target: hst.AbsPrivateTmp}},
}
- c.Container.Device = false
+ c.Container.Flags &= ^hst.FDevice
return c
}
configSmall := newConfigSmall()