Skip to content

Commit 2c74f86

Browse files
committed
Employ jq and state command to make sure that pid-file contains the right information
Signed-off-by: Wang Long <[email protected]>
1 parent d6b68e8 commit 2c74f86

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ RUN apt-get update && apt-get install -y \
88
curl \
99
gawk \
1010
iptables \
11+
jq \
1112
pkg-config \
1213
libaio-dev \
1314
libcap-dev \

tests/integration/create.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function teardown() {
5151

5252
run cat pid.txt
5353
[ "$status" -eq 0 ]
54-
[[ ${lines[0]} =~ [0-9]+ ]]
54+
[[ ${lines[0]} == $(__runc state test_busybox | jq '.pid') ]]
5555

5656
# start the command
5757
runc start test_busybox

tests/integration/exec.bats

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ function teardown() {
4242
run cat pid.txt
4343
[ "$status" -eq 0 ]
4444
[[ ${lines[0]} =~ [0-9]+ ]]
45+
[[ ${lines[0]} != $(__runc state test_busybox | jq '.pid') ]]
4546
}
4647

4748
@test "runc exec ls -la" {

tests/integration/start_detached.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ function teardown() {
5353

5454
run cat pid.txt
5555
[ "$status" -eq 0 ]
56-
[[ ${lines[0]} =~ [0-9]+ ]]
56+
[[ ${lines[0]} == $(__runc state test_busybox | jq '.pid') ]]
5757
}

0 commit comments

Comments
 (0)