Skip to content

validation-tests: fix several tests#687

Merged
zhouhao3 merged 8 commits intoopencontainers:masterfrom
giuseppe:fix
Mar 6, 2019
Merged

validation-tests: fix several tests#687
zhouhao3 merged 8 commits intoopencontainers:masterfrom
giuseppe:fix

Conversation

@giuseppe
Copy link
Copy Markdown
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>
util.Fatal(err)
}
g.AddProcessCapabilityBounding("CAP_TEST")
g.Config.Process.Capabilities.Bounding = append(g.Config.Process.Capabilities.Bounding, "CAP_TEST")
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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