Group all privileged logic together

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
This commit is contained in:
Yanqiang Miao
2017-08-21 18:55:06 +08:00
parent dcc3cb2a05
commit 8adad23015
2 changed files with 72 additions and 56 deletions

View File

@@ -419,7 +419,10 @@ func TestPrivilegedBindMount(t *testing.T) {
t.Logf("TestCase %q", desc)
g := generate.New()
g.SetRootReadonly(test.readonlyRootFS)
addOCIBindMounts(&g, nil, test.privileged)
addOCIBindMounts(&g, nil)
if test.privileged {
setOCIBindMountsPrivileged(&g)
}
spec := g.Spec()
if test.expectedSysFSRO {
checkMount(t, spec.Mounts, "sysfs", "/sys", "sysfs", []string{"ro"}, nil)