From 2fc89b5935645611fde4022f1245126fd885eeea Mon Sep 17 00:00:00 2001 From: Ramil Valitov Date: Mon, 21 Sep 2020 20:41:38 +0300 Subject: [PATCH] [fix] options --- tests/all.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/all.sh b/tests/all.sh index 903280b..81307b1 100644 --- a/tests/all.sh +++ b/tests/all.sh @@ -774,16 +774,15 @@ testDiscoverScriptTimeout() { function runZabbixDiscoverReturnsData() { local DATA local IS_OK - local OPTIONS='"/php-fpm-status"' + local ARG=$1 - local ARG_ID=1 - local ARGS_COUNT=$# + if [[ -n $ARG ]]; then + # shellcheck disable=SC2140 + DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["$ARG","/php-fpm-status"]) + else + DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["/php-fpm-status"]) + fi - while [ $ARG_ID -le $ARGS_COUNT ]; do - OPTIONS="$OPTIONS,\"$1\"" - done - - DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["$OPTIONS"]) IS_OK=$(echo "$DATA" | grep -F '{"data":[{"{#POOLNAME}"') printElapsedTime assertNotNull "Discover script failed: $DATA" "$IS_OK"