mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Employ jq and state command to make sure that pid-file contains the right information
Signed-off-by: Wang Long <long.wanglong@huawei.com>
This commit is contained in:
@@ -8,6 +8,7 @@ RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
gawk \
|
||||
iptables \
|
||||
jq \
|
||||
pkg-config \
|
||||
libaio-dev \
|
||||
libcap-dev \
|
||||
|
||||
@@ -51,7 +51,7 @@ function teardown() {
|
||||
|
||||
run cat pid.txt
|
||||
[ "$status" -eq 0 ]
|
||||
[[ ${lines[0]} =~ [0-9]+ ]]
|
||||
[[ ${lines[0]} == $(__runc state test_busybox | jq '.pid') ]]
|
||||
|
||||
# start the command
|
||||
runc start test_busybox
|
||||
|
||||
@@ -42,6 +42,7 @@ function teardown() {
|
||||
run cat pid.txt
|
||||
[ "$status" -eq 0 ]
|
||||
[[ ${lines[0]} =~ [0-9]+ ]]
|
||||
[[ ${lines[0]} != $(__runc state test_busybox | jq '.pid') ]]
|
||||
}
|
||||
|
||||
@test "runc exec ls -la" {
|
||||
|
||||
@@ -53,5 +53,5 @@ function teardown() {
|
||||
|
||||
run cat pid.txt
|
||||
[ "$status" -eq 0 ]
|
||||
[[ ${lines[0]} =~ [0-9]+ ]]
|
||||
[[ ${lines[0]} == $(__runc state test_busybox | jq '.pid') ]]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user