Skip to content

Commit 9e919c6

Browse files
committed
runtimetest: fix root readonly check
The rootfs might not be readable despite spec.Root.Readonly being false and that's not a spec violation. Example: the rootfs belong to an unmapped uid. This test is useful for validation/root_readonly_true.go Delete validation/root_readonly_false.go since that's not a spec violation. Signed-off-by: Alban Crequy <alban@kinvolk.io>
1 parent cb96426 commit 9e919c6

2 files changed

Lines changed: 1 addition & 20 deletions

File tree

cmd/runtimetest/main.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,7 @@ func validateRootFS(spec *rspec.Spec) error {
328328
if err == nil {
329329
return specerror.NewError(specerror.RootReadonlyImplement, fmt.Errorf("rootfs must be readonly"), rspec.Version)
330330
}
331-
} else {
332-
err := testWriteAccess("/")
333-
if err != nil {
334-
return specerror.NewError(specerror.RootReadonlyImplement, fmt.Errorf("rootfs must not be readonly"), rspec.Version)
335-
}
336-
}
331+
} // no need to check the else case: unwriteable root is not a spec violation
337332

338333
return nil
339334
}

validation/root_readonly_false.go

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)