Skip to content

validation: Implement ProcArgsApplyUntilStart#602

Merged
liangchenye merged 1 commit intoopencontainers:masterfrom
zhouhao3:create-validation
Mar 14, 2018
Merged

validation: Implement ProcArgsApplyUntilStart#602
liangchenye merged 1 commit intoopencontainers:masterfrom
zhouhao3:create-validation

Conversation

@zhouhao3
Copy link
Copy Markdown

Signed-off-by: Zhou Hao zhouhao@cn.fujitsu.com

@zhouhao3 zhouhao3 mentioned this pull request Mar 14, 2018
44 tasks
Comment thread validation/start.go Outdated
}
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)
Copy link
Copy Markdown
Member

@liangchenye liangchenye Mar 14, 2018

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
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 create-validation branch from d274058 to fead0d7 Compare March 14, 2018 06:21
Signed-off-by: Zhou Hao <zhouhao@cn.fujitsu.com>
@zhouhao3 zhouhao3 force-pushed the create-validation branch from fead0d7 to d5630f7 Compare March 14, 2018 06:23
@liangchenye
Copy link
Copy Markdown
Member

liangchenye commented Mar 14, 2018

LGTM

Approved with PullApprove

@liangchenye liangchenye merged commit 36e9b37 into opencontainers:master Mar 14, 2018
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