diff --git a/test/090_docker_restart_policy_2_test.sh b/test/090_docker_restart_policy_2_test.sh index b8b9a5a7..dba02595 100755 --- a/test/090_docker_restart_policy_2_test.sh +++ b/test/090_docker_restart_policy_2_test.sh @@ -4,17 +4,13 @@ start_suite "Test docker restart policy" -pidof() { - docker_on $1 inspect -f '{{.State.Pid}}' $2 -} - check_restart() { - OLD_PID=$(pidof $1 $2) + OLD_PID=$(container_pid $1 $2) run_on $1 sudo kill $OLD_PID for i in $(seq 1 30); do - NEW_PID=$(pidof $1 $2) + NEW_PID=$(container_pid $1 $2) if [ $NEW_PID != 0 -a $NEW_PID != $OLD_PID ] ; then return 0 diff --git a/test/config.sh b/test/config.sh index 3d23562f..aefdd6b7 100644 --- a/test/config.sh +++ b/test/config.sh @@ -183,6 +183,10 @@ container_ip() { weave_on $1 ps $2 | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' } +container_pid() { + docker_on $1 inspect -f '{{.State.Pid}}' $2 +} + # assert_dns_record [ ...] assert_dns_record() { local host=$1