Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtimetest: add posixValidations #510

Merged
merged 3 commits into from
Nov 17, 2017

Conversation

zhouhao3
Copy link

@zhouhao3 zhouhao3 commented Nov 3, 2017

Signed-off-by: Zhou Hao [email protected]

@@ -82,7 +82,7 @@ func loadSpecConfig(path string) (spec *rspec.Spec, err error) {
}

// should be included by other platform specified process validation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The “fix process validation” commit should remove this comment too.

}
func validateUser(spec *rspec.Spec) error {
if runtime.GOOS == "windows" {
return nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this function should be validatePOSIXUser to match the spec and then used in both linuxValidatations and a new solarisValidations? Or a new posixValidations which is included for both linux and solaris platforms? The spec has Windows-specific user stuff, but all of its RFC 2119 language is currently config-oriented and covered by the JSON Schema validation.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or a new posixValidations which is included for both linux and solaris platforms?

I think it would be better. I'm going to do that.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated, PTAL.

@zhouhao3 zhouhao3 force-pushed the user-check-runtiemtest branch from 6c9942a to 12076d7 Compare November 6, 2017 02:22
@zhouhao3 zhouhao3 force-pushed the user-check-runtiemtest branch from 12076d7 to 45b2686 Compare November 6, 2017 02:26
@zhouhao3 zhouhao3 changed the title runtimetest: fix process validation runtimetest: add posixValidations Nov 6, 2017
@zhouhao3 zhouhao3 force-pushed the user-check-runtiemtest branch from 6a6fee7 to 84a0824 Compare November 6, 2017 02:43
@@ -82,10 +82,6 @@ func loadSpecConfig(path string) (spec *rspec.Spec, err error) {
}

func validateUser(spec *rspec.Spec) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be validatePosixUser to make it extra-clear that it's not covering Windows users.

@@ -643,11 +634,6 @@ func mountMatch(configMount rspec.Mount, sysMount *mount.Info) error {
}

func validateMounts(spec *rspec.Spec) error {
if runtime.GOOS == "windows" {
logrus.Warnf("mounts validation not yet implemented for OS %q", runtime.GOOS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to keep this. mounts is specified for all platforms, and we just aren't testing the Windows-specific parts of that yet.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can change to validatePosixMounts. Because this is only validated against POSIX-platform Mounts.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can change to validatePosixMounts. Because this is only validated against POSIX-platform Mounts.

It's also checking the mount order, which is a cross-platform requirement. Windows checks for mount order could involve extending cmd/runtimetest/mount to support Windows, in which case we'd want to keep this valdation generic, with per-platform guards for the POSIX-specific type checks, etc. Or we can duplicate the order checks in a separate validateWindowsMounts, in which case calling all of the current logic validatePosixMounts is fine.

@zhouhao3 zhouhao3 force-pushed the user-check-runtiemtest branch from 84a0824 to 8765570 Compare November 7, 2017 02:19
@Mashimiao Mashimiao added this to the v0.4.0 milestone Nov 15, 2017
@liangchenye
Copy link
Member

liangchenye commented Nov 17, 2017

LGTM

Approved with PullApprove

1 similar comment
@Mashimiao
Copy link

Mashimiao commented Nov 17, 2017

LGTM

Approved with PullApprove

@Mashimiao Mashimiao merged commit bdbdb90 into opencontainers:master Nov 17, 2017
@zhouhao3 zhouhao3 deleted the user-check-runtiemtest branch November 17, 2017 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants