aboutsummaryrefslogtreecommitdiffhomepage
path: root/hst/fsbind_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-08-26 00:50:23 +0900
committerOphestra <cat@gensokyo.uk>2025-08-26 00:50:23 +0900
commit878b66022e7573ca89fd1fbc266133c7776a98dd (patch)
tree006ff7de65f9ab291186088d7eb3c9e9745b1a43 /hst/fsbind_test.go
parent2e0a4795f6a0016832d8fc51884abce4d01a8a58 (diff)
hst/fsbind: optional ensure source
This exposes the BindEnsure flag of BindMountOp. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'hst/fsbind_test.go')
-rw-r--r--hst/fsbind_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/hst/fsbind_test.go b/hst/fsbind_test.go
index b2fb0f7a..4b9cc19c 100644
--- a/hst/fsbind_test.go
+++ b/hst/fsbind_test.go
@@ -10,6 +10,8 @@ import (
func TestFSBind(t *testing.T) {
checkFs(t, []fsTestCase{
{"nil", (*hst.FSBind)(nil), false, nil, nil, nil, "<invalid>"},
+ {"ensure optional", &hst.FSBind{Source: m("/"), Ensure: true, Optional: true},
+ false, nil, nil, nil, "<invalid>"},
{"full", &hst.FSBind{
Target: m("/dev"),
@@ -23,6 +25,18 @@ func TestFSBind(t *testing.T) {
}}, m("/dev"), ms("/mnt/dev"),
"d+/mnt/dev:/dev"},
+ {"full ensure", &hst.FSBind{
+ Target: m("/dev"),
+ Source: m("/mnt/dev"),
+ Ensure: true,
+ Device: true,
+ }, true, container.Ops{&container.BindMountOp{
+ Source: m("/mnt/dev"),
+ Target: m("/dev"),
+ Flags: container.BindWritable | container.BindDevice | container.BindEnsure,
+ }}, m("/dev"), ms("/mnt/dev"),
+ "d-/mnt/dev:/dev"},
+
{"full write dev", &hst.FSBind{
Target: m("/dev"),
Source: m("/mnt/dev"),