Skip to content

Commit

Permalink
runtimetest: fix root readonly check
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
alban committed Mar 13, 2018
1 parent cb96426 commit 9e919c6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
7 changes: 1 addition & 6 deletions cmd/runtimetest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,7 @@ func validateRootFS(spec *rspec.Spec) error {
if err == nil {
return specerror.NewError(specerror.RootReadonlyImplement, fmt.Errorf("rootfs must be readonly"), rspec.Version)
}
} else {
err := testWriteAccess("/")
if err != nil {
return specerror.NewError(specerror.RootReadonlyImplement, fmt.Errorf("rootfs must not be readonly"), rspec.Version)
}
}
} // no need to check the else case: unwriteable root is not a spec violation

return nil
}
Expand Down
14 changes: 0 additions & 14 deletions validation/root_readonly_false.go

This file was deleted.

0 comments on commit 9e919c6

Please sign in to comment.