add test cases for create command
This patch add test `--pid-file` option for create command. Signed-off-by: Wang Long <long.wanglong@huawei.com>
This commit is contained in:
parent
2a5001c1bc
commit
596a4c397c
|
@ -39,3 +39,23 @@ function teardown() {
|
||||||
|
|
||||||
testcontainer test_busybox running
|
testcontainer test_busybox running
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "runc create --pid-file" {
|
||||||
|
runc create --pid-file pid.txt --console /dev/pts/ptmx test_busybox
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
|
||||||
|
testcontainer test_busybox created
|
||||||
|
|
||||||
|
# check pid.txt was generated
|
||||||
|
[ -e pid.txt ]
|
||||||
|
|
||||||
|
run cat pid.txt
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
[[ ${lines[0]} =~ [0-9]+ ]]
|
||||||
|
|
||||||
|
# start the command
|
||||||
|
runc start test_busybox
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
|
||||||
|
testcontainer test_busybox running
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue