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

validation: add a new test for NSPathMatchTypeError #636

Merged

Conversation

dongsupark
Copy link
Contributor

checkNSPathMatchType checks if the container returns an error when deliberately setting a wrong namespace type. Doing that, it is possible to verify NSPathMatchTypeError, i.e. The runtime MUST generate an error if path is not associated with a namespace of type "type".

See also #572
/cc @alban

Signed-off-by: Dongsu Park [email protected]


err = util.RuntimeOutsideValidate(g, func(config *rspec.Spec, state *rspec.State) error {
return nil
})

Choose a reason for hiding this comment

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

I think this will be better: err = util.RuntimeOutsideValidate(g, nil)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@q384566678 Right. I've changed it as you suggested.

`checkNSPathMatchType` checks if the container returns an error when
deliberately setting a wrong namespace type. Doing that, it is possible
to verify `NSPathMatchTypeError`, i.e. `The runtime MUST generate an
error if path is not associated with a namespace of type "type"`.

See also opencontainers#572

Signed-off-by: Dongsu Park <[email protected]>
@dongsupark dongsupark force-pushed the dongsu/test-path-match-type branch from d4961ab to 1fb00d9 Compare May 29, 2018 11:16
We should use an existing helper `util.GetRuntimeToolsNamespaces()`
instead of writing an internal function again.

Signed-off-by: Dongsu Park <[email protected]>
@dongsupark
Copy link
Contributor Author

Rebased, and added another commit to use an existing helper function util.GetRuntimeToolsNamespaces().

@zhouhao3
Copy link

zhouhao3 commented May 30, 2018

LGTM

Approved with PullApprove

@zhouhao3 zhouhao3 merged commit 128c588 into opencontainers:master May 30, 2018
@zhouhao3 zhouhao3 mentioned this pull request May 30, 2018
44 tasks
@dongsupark dongsupark deleted the dongsu/test-path-match-type branch May 30, 2018 08:16
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.

2 participants