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-tests: fix several tests #687

Merged
merged 8 commits into from
Mar 6, 2019
Merged

Conversation

giuseppe
Copy link
Member

@giuseppe giuseppe commented Mar 3, 2019

this PR includes several minor fixes to the validation tests. I've found these issues while preparing crun to be fully OCI compliant: https://github.com/giuseppe/crun/pull/16

More details are included in the commit message for each patch.

I've added a patch for the Makefile to print what validation-tests are used. I want to use it on Travis to easily read the list of the tests and disabling some of them, namely some cgroup tests that require a special configuration (I could just repeat the same find query, but I'd prefer to keep this logic in the runtime-tools Makefile)

giuseppe added 8 commits March 3, 2019 10:30
AddProcessCapabilityBounding() checks if the capability is correct
before adding it, so the invalid capability won't be added.

Add it directly to the list, avoiding the validity check in
AddProcessCapabilityBounding().

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
otherwise all the tests will get assigned the incorrect OCI version
and fail.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
it is not supported on all the types of file systems so it makes no
sense to check that it is present on all the mounts.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
the OCI specs state that it is valid to delete a container only when
it is in the "stopped" state.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
if we don't clean it up, the next test cannot re-use the same
container ID and it will fail.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
reduce waiting time from 10 seconds to 3 seconds when we check for
"delete" effects.  The test would be very slow otherwise and cause the
TAP driver to timeout.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@@ -20,7 +20,7 @@ func main() {
if err != nil {
util.Fatal(err)
}
g.AddProcessCapabilityBounding("CAP_TEST")
g.Config.Process.Capabilities.Bounding = append(g.Config.Process.Capabilities.Bounding, "CAP_TEST")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a bug in the helper function that we should fix?

Copy link
Member Author

Choose a reason for hiding this comment

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

no, I think it is fine that the helper function checks whether the input is valid and rejects unknown capabilities

@zhouhao3
Copy link

zhouhao3 commented Mar 5, 2019

LGTM

Approved with PullApprove

@zhouhao3 zhouhao3 merged commit 262c5e5 into opencontainers:master Mar 6, 2019
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.

3 participants