From 1a2dbcfac6fda5f0c80d845893ddeffc8316d33d Mon Sep 17 00:00:00 2001 From: Antoine Cotten Date: Thu, 7 Oct 2021 01:10:53 +0200 Subject: [PATCH] ci: Fix Metricbeat test The naming scheme of containers created by Compose has changed in V2. Ref. docker/compose#8655 --- .github/workflows/scripts/run-tests-metricbeat.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/run-tests-metricbeat.sh b/.github/workflows/scripts/run-tests-metricbeat.sh index b9909eb820..46d0d7d554 100755 --- a/.github/workflows/scripts/run-tests-metricbeat.sh +++ b/.github/workflows/scripts/run-tests-metricbeat.sh @@ -25,7 +25,7 @@ poll_ready "$cid_mb" "http://${ip_mb}:5066/?pretty" # agent.type:"metricbeat" # AND event.module:"docker" # AND event.dataset:"docker.container" -# AND container.name:"docker-elk_elasticsearch_1" +# AND container.name:"docker-elk-elasticsearch-1" # log 'Searching a document generated by Metricbeat' @@ -34,7 +34,7 @@ declare -i count # retry for max 60s (30*2s) for _ in $(seq 1 30); do - response="$(curl "http://${ip_es}:9200/metricbeat-*/_search?q=agent.type:%22metricbeat%22%20AND%20event.module:%22docker%22%20AND%20event.dataset:%22docker.container%22%20AND%20container.name:%22docker-elk_elasticsearch_1%22&pretty" -s -u elastic:testpasswd)" + response="$(curl "http://${ip_es}:9200/metricbeat-*/_search?q=agent.type:%22metricbeat%22%20AND%20event.module:%22docker%22%20AND%20event.dataset:%22docker.container%22%20AND%20container.name:%22docker-elk-elasticsearch-1%22&pretty" -s -u elastic:testpasswd)" set +u # prevent "unbound variable" if assigned value is not an integer count="$(jq -rn --argjson data "${response}" '$data.hits.total.value')"