aboutsummaryrefslogtreecommitdiffhomepage
path: root/hst/fsbind_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-08-25 17:44:12 +0900
committerOphestra <cat@gensokyo.uk>2025-08-25 17:44:12 +0900
commit059164d4fa80047fc50bffc1582424d00cf4c139 (patch)
treeea50a0ac44e3f878b9b6ba3fbefee48e01e94958 /hst/fsbind_test.go
parent8db906ee64a1ce9d1fd602d161d0681d2a6ba27d (diff)
hst/fsbind: optional autoroot behaviour
This allows autoroot to be configured via Filesystem. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'hst/fsbind_test.go')
-rw-r--r--hst/fsbind_test.go31
1 files changed, 31 insertions, 0 deletions
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, "<invalid>"},
+
+ {"autoroot bad target", &hst.FSBind{
+ Source: m("/"),
+ Target: m("/etc/"),
+ AutoRoot: true,
+ }, false, nil, nil, nil, "<invalid>"},
+
+ {"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"},
})
}