new test helper

This commit is contained in:
ofreax 2015-07-17 09:23:24 +02:00
parent 345188086e
commit 5084fe2256
1 changed files with 17 additions and 7 deletions

View File

@ -34,6 +34,10 @@ is_service_running() {
is_service_running_by_cid $CONTAINER_ID $1 is_service_running_by_cid $CONTAINER_ID $1
} }
is_file_exists() {
is_file_exists_by_cid $CONTAINER_ID $1
}
wait_service() { wait_service() {
wait_service_by_cid $CONTAINER_ID $@ wait_service_by_cid $CONTAINER_ID $@
} }
@ -78,12 +82,18 @@ is_service_running_by_cid() {
docker exec $1 ps cax | grep $2 > /dev/null 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() { wait_service_by_cid() {
cid=$1 cid=$1
sleep 1
# first wait image init end # 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 do
sleep 1 sleep 1
done done