validation: Implement ProcArgsApplyUntilStart#602
Merged
liangchenye merged 1 commit intoopencontainers:masterfrom Mar 14, 2018
Merged
validation: Implement ProcArgsApplyUntilStart#602liangchenye merged 1 commit intoopencontainers:masterfrom
liangchenye merged 1 commit intoopencontainers:masterfrom
Conversation
liangchenye
reviewed
Mar 14, 2018
| } | ||
| outputData, outputErr := ioutil.ReadFile(output) | ||
| // check the output | ||
| util.SpecErrorOK(t, outputErr != nil || string(outputData) != "process called\n", specerror.NewError(specerror.ProcArgsApplyUntilStart, fmt.Errorf("`process.args` MUST NOT be applied until triggered by the start operation"), rspecs.Version), outputErr) |
Member
There was a problem hiding this comment.
Logically, we cannot get the conclusion that the proc is not applied even 'outputErr != nil'.
Maybe there is a possibility that echo > output is executed, but not running expected (generate a file).
In this test case (and other test cases also), we make the assumption (assumption A) that
commands like 'echo/sleep/touch' will always running as expected.
In this commit, if outputErr is nil and string(outputData) != "process called\n", we will get this conclusion:
the process is applied, but not running as expected: put a wrong message to the output file.
It is different with ProcArgsApplyUntilStart and it also violates our assumption A.
So I suggest we can make it simpler by just checking the existence of the output file.
d274058 to
fead0d7
Compare
Signed-off-by: Zhou Hao <zhouhao@cn.fujitsu.com>
fead0d7 to
d5630f7
Compare
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Zhou Hao zhouhao@cn.fujitsu.com