Skip to content

Commit 596a4c3

Browse files
committed
add test cases for create command
This patch add test `--pid-file` option for create command. Signed-off-by: Wang Long <[email protected]>
1 parent 2a5001c commit 596a4c3

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/integration/create.bats

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,23 @@ function teardown() {
3939

4040
testcontainer test_busybox running
4141
}
42+
43+
@test "runc create --pid-file" {
44+
runc create --pid-file pid.txt --console /dev/pts/ptmx test_busybox
45+
[ "$status" -eq 0 ]
46+
47+
testcontainer test_busybox created
48+
49+
# check pid.txt was generated
50+
[ -e pid.txt ]
51+
52+
run cat pid.txt
53+
[ "$status" -eq 0 ]
54+
[[ ${lines[0]} =~ [0-9]+ ]]
55+
56+
# start the command
57+
runc start test_busybox
58+
[ "$status" -eq 0 ]
59+
60+
testcontainer test_busybox running
61+
}

0 commit comments

Comments
 (0)