aboutsummaryrefslogtreecommitdiffhomepage
path: root/hst/fsbind_test.go
diff options
context:
space:
mode:
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"},
})
}