aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/container_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-05-04 02:07:52 +0900
committerOphestra <cat@gensokyo.uk>2026-05-04 02:29:56 +0900
commitda11b26ec16ef9ed61045fdbb03c4090286bfeba (patch)
treeef6120c9c274276eb90976dc49a1a0808a3914b9 /container/container_test.go
parent024489e800a3324e2305546598b606357606e274 (diff)
container/initoverlay: configure via fsconfig
This works around the page size limit at the cost of negligible performance regressions. Closes #34. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/container_test.go')
-rw-r--r--container/container_test.go24
1 files changed, 16 insertions, 8 deletions
diff --git a/container/container_test.go b/container/container_test.go
index 41d39f68..1bdc28a1 100644
--- a/container/container_test.go
+++ b/container/container_test.go
@@ -16,6 +16,7 @@ import (
"strings"
"syscall"
"testing"
+ _ "unsafe" // for go:linkname
"hakurei.app/check"
"hakurei.app/command"
@@ -233,6 +234,9 @@ func earlyMnt(mnt ...*vfs.MountInfoEntry) func(*testing.T, context.Context) []*v
return func(*testing.T, context.Context) []*vfs.MountInfoEntry { return mnt }
}
+//go:linkname toHost hakurei.app/container.toHost
+func toHost(name string) string
+
var containerTestCases = []struct {
name string
filter bool
@@ -332,13 +336,15 @@ var containerTestCases = []struct {
func(t *testing.T, ctx context.Context) []*vfs.MountInfoEntry {
return []*vfs.MountInfoEntry{
ent("/", hst.PrivateTmp, "rw", "overlay", "overlay",
- "rw,lowerdir="+
- container.InternalToHostOvlEscape(ctx.Value(testVal("lower0")).(*check.Absolute).String())+":"+
- container.InternalToHostOvlEscape(ctx.Value(testVal("lower1")).(*check.Absolute).String())+
+ "rw"+
+ ",lowerdir+="+
+ toHost(ctx.Value(testVal("lower0")).(*check.Absolute).String())+
+ ",lowerdir+="+
+ toHost(ctx.Value(testVal("lower1")).(*check.Absolute).String())+
",upperdir="+
- container.InternalToHostOvlEscape(ctx.Value(testVal("upper")).(*check.Absolute).String())+
+ toHost(ctx.Value(testVal("upper")).(*check.Absolute).String())+
",workdir="+
- container.InternalToHostOvlEscape(ctx.Value(testVal("work")).(*check.Absolute).String())+
+ toHost(ctx.Value(testVal("work")).(*check.Absolute).String())+
",redirect_dir=nofollow,uuid=on,userxattr"),
}
},
@@ -388,9 +394,11 @@ var containerTestCases = []struct {
func(t *testing.T, ctx context.Context) []*vfs.MountInfoEntry {
return []*vfs.MountInfoEntry{
ent("/", hst.PrivateTmp, "rw", "overlay", "overlay",
- "ro,lowerdir="+
- container.InternalToHostOvlEscape(ctx.Value(testVal("lower0")).(*check.Absolute).String())+":"+
- container.InternalToHostOvlEscape(ctx.Value(testVal("lower1")).(*check.Absolute).String())+
+ "ro"+
+ ",lowerdir+="+
+ toHost(ctx.Value(testVal("lower0")).(*check.Absolute).String())+
+ ",lowerdir+="+
+ toHost(ctx.Value(testVal("lower1")).(*check.Absolute).String())+
",redirect_dir=nofollow,userxattr"),
}
},