From 878b66022e7573ca89fd1fbc266133c7776a98dd Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 26 Aug 2025 00:50:23 +0900 Subject: hst/fsbind: optional ensure source This exposes the BindEnsure flag of BindMountOp. Signed-off-by: Ophestra --- hst/fsbind_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'hst/fsbind_test.go') 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, ""}, + {"ensure optional", &hst.FSBind{Source: m("/"), Ensure: true, Optional: true}, + false, nil, nil, nil, ""}, {"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"), -- cgit v1.3.1