From 596a4c397cc0b166ea0f414665b3cb7ed82b234b Mon Sep 17 00:00:00 2001 From: Wang Long Date: Thu, 20 Oct 2016 12:05:05 +0800 Subject: [PATCH] add test cases for create command This patch add test `--pid-file` option for create command. Signed-off-by: Wang Long --- tests/integration/create.bats | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/integration/create.bats b/tests/integration/create.bats index 0b6d91b7e..20ed328e3 100644 --- a/tests/integration/create.bats +++ b/tests/integration/create.bats @@ -39,3 +39,23 @@ function teardown() { 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 +}