new test helper
This commit is contained in:
parent
345188086e
commit
5084fe2256
|
@ -34,6 +34,10 @@ is_service_running() {
|
|||
is_service_running_by_cid $CONTAINER_ID $1
|
||||
}
|
||||
|
||||
is_file_exists() {
|
||||
is_file_exists_by_cid $CONTAINER_ID $1
|
||||
}
|
||||
|
||||
wait_service() {
|
||||
wait_service_by_cid $CONTAINER_ID $@
|
||||
}
|
||||
|
@ -78,12 +82,18 @@ is_service_running_by_cid() {
|
|||
docker exec $1 ps cax | grep $2 > /dev/null
|
||||
}
|
||||
|
||||
is_file_exists_by_cid() {
|
||||
docker exec $1 cat "/etc/my_init_startup_files_completed" > /dev/null 2>&1
|
||||
}
|
||||
|
||||
wait_service_by_cid() {
|
||||
|
||||
cid=$1
|
||||
|
||||
sleep 1
|
||||
|
||||
# first wait image init end
|
||||
while ! is_service_running_by_cid $cid syslog-ng
|
||||
while ! is_file_exists_by_cid $cid /etc/my_init_startup_files_completed
|
||||
do
|
||||
sleep 1
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue