Skip to content

Commit c08563d

Browse files
committed
runtimetest: fix root readonly check
The rootfs might not be readable despite spec.Root.Readonly being false when the rootfs belong to an unmapped uid. Just skip the test in that case. The test will still be executed for validation/root_readonly_{false,true}.go Signed-off-by: Alban Crequy <[email protected]>
1 parent cb96426 commit c08563d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmd/runtimetest/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,10 @@ func validateRootFS(spec *rspec.Spec) error {
329329
return specerror.NewError(specerror.RootReadonlyImplement, fmt.Errorf("rootfs must be readonly"), rspec.Version)
330330
}
331331
} else {
332+
if spec.Linux != nil && len(spec.Linux.UIDMappings) != 0 {
333+
// Skip the test in case of user namespaces
334+
return nil
335+
}
332336
err := testWriteAccess("/")
333337
if err != nil {
334338
return specerror.NewError(specerror.RootReadonlyImplement, fmt.Errorf("rootfs must not be readonly"), rspec.Version)

0 commit comments

Comments
 (0)