tripleo-upgrade/templates/fip_http_check_start.sh.j2
Yurii Prokulevych 94d6d420c5 Adjust load test templates.
Don't discover FIP of instance every time but re-use it.
In case of re-run after failure some scripts might be still running,
that's why those tried to be killed. If there're no scripts found
command will exit with error, so handle this accordingly.

Change-Id: Ie8ee915b2961be22f6b6e3d66cfe2e4ec4631252
2018-08-13 14:07:53 +02:00

17 lines
552 B
Django/Jinja

#!/bin/env bash
set -euo pipefail
if [[ ! -s {{ working_dir }}/fip.sh ]]; then
echo export FIP=$(openstack floating ip list -f json | jq -r -c '.[] | select(.Port) | .["Floating IP Address"]' | head -1) > {{ working_dir }}/fip.sh
fi
source {{ working_dir }}/fip.sh
while true; do
curl --location --silent --show-error --max-time 5 \
--write-out "HTTP Code: %{http_code}\nTotal Time: %{time_total} sec\nEffective URL: %{url_effective}\n\n" \
http://${FIP}/ 2>/dev/null >> {{ working_dir }}/http_response.log
sleep 1
done