From 059164d4fa80047fc50bffc1582424d00cf4c139 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 25 Aug 2025 17:44:12 +0900 Subject: hst/fsbind: optional autoroot behaviour This allows autoroot to be configured via Filesystem. Signed-off-by: Ophestra --- hst/fsbind_test.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'hst/fsbind_test.go') diff --git a/hst/fsbind_test.go b/hst/fsbind_test.go index 21d3640d..750dd93a 100644 --- a/hst/fsbind_test.go +++ b/hst/fsbind_test.go @@ -62,5 +62,36 @@ func TestFSBind(t *testing.T) { Target: m("/"), }}, m("/"), ms("/"), "*/"}, + + {"autoroot nil target", &hst.FSBind{ + Source: m("/"), + AutoRoot: true, + }, false, nil, nil, nil, ""}, + + {"autoroot bad target", &hst.FSBind{ + Source: m("/"), + Target: m("/etc/"), + AutoRoot: true, + }, false, nil, nil, nil, ""}, + + {"autoroot pd", &hst.FSBind{ + Target: m("/"), + Source: m("/"), + Write: true, + AutoRoot: true, + }, true, container.Ops{&container.AutoRootOp{ + Host: m("/"), + Flags: container.BindWritable, + }}, m("/"), ms("/"), "autoroot:w"}, + + {"autoroot silly", &hst.FSBind{ + Target: m("/"), + Source: m("/etc"), + Write: true, + AutoRoot: true, + }, true, container.Ops{&container.AutoRootOp{ + Host: m("/etc"), + Flags: container.BindWritable, + }}, m("/"), ms("/etc"), "autoroot:w:/etc"}, }) } -- cgit v1.3.1