-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
add test cases for create command #1132
Conversation
testcontainer test_busybox created | ||
|
||
# check pid.txt was generated | ||
[ -e pid.txt ] |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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]+ ]]
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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]>
633b47b
to
596a4c3
Compare
This patch add test
--pid-file
option for create command.Signed-off-by: Wang Long [email protected]