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

add test cases for create command #1132

Merged

Conversation

datawolf
Copy link
Contributor

This patch add test --pid-file option for create command.

Signed-off-by: Wang Long [email protected]

testcontainer test_busybox created

# check pid.txt was generated
[ -e pid.txt ]
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should also check that pid matches the pid shown in runc list? Or is that not really worth the effort?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is not necessary to check that pid matches the pid shown in runc list. but we can check the content of the file as following:

run cat pid.txt
[ "status" -eq 0 ]
[[ ${lines[0]} =~ [0-9]+ ]]

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure that it's "not necessary". I don't think we have a test that makes sure that pid-file contains the right information? That's why I was suggesting it. But yeah, that change is also fine.

Copy link
Contributor Author

@datawolf datawolf Oct 20, 2016

Choose a reason for hiding this comment

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

I thought for a moment. the pid is sent by C program to Go program and write to file by Go. It is necessary to check it matches. I update the patch with

run cat pid.txt
[ "status" -eq 0 ]
[[ ${lines[0]} =~ [0-9]+ ]]

I will open another pr to achieve this, because other integration tests also need to check, eg: start_hello.bats,start_detached.bats.

thanks

Copy link
Member

Choose a reason for hiding this comment

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

Alright, sure.

This patch add test `--pid-file` option for create command.

Signed-off-by: Wang Long <[email protected]>
@datawolf datawolf force-pushed the add-integration-test-for-create branch from 633b47b to 596a4c3 Compare October 20, 2016 08:24
@cyphar
Copy link
Member

cyphar commented Oct 20, 2016

LGTM.

Approved with PullApprove

@hqhq
Copy link
Contributor

hqhq commented Oct 22, 2016

LGTM

Approved with PullApprove

@hqhq hqhq merged commit 850b9c0 into opencontainers:master Oct 22, 2016
@datawolf datawolf deleted the add-integration-test-for-create branch November 8, 2016 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants