Fix test failure when user can't mount temp dir

PiperOrigin-RevId: 197491098
Change-Id: Ifb75bd4e4f41b84256b6d7afc4b157f6ce3839f3
This commit is contained in:
Fabricio Voznika
2018-05-21 17:48:04 -07:00
committed by Shentubot
parent 61b0b19497
commit ed2b86a549
+11
View File
@@ -434,6 +434,17 @@ func TestCapabilities(t *testing.T) {
Type: "bind",
})
// Capability below is needed to mount TempDir above in case the user doesn't
// have access to all parents that lead to TempDir.
caps := []string{"CAP_DAC_OVERRIDE"}
spec.Process.Capabilities = &specs.LinuxCapabilities{
Bounding: caps,
Effective: caps,
Inheritable: caps,
Permitted: caps,
Ambient: caps,
}
rootDir, bundleDir, conf, err := setupContainer(spec)
if err != nil {
t.Fatalf("error setting up container: %v", err)