From 92222fb29301462298d3127d34862374cdc1d95a Mon Sep 17 00:00:00 2001 From: Ramil Valitov Date: Mon, 21 Sep 2020 14:36:30 +0300 Subject: [PATCH] [fix] max time check --- tests/all.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/all.sh b/tests/all.sh index 752fd4c..e40633e 100644 --- a/tests/all.sh +++ b/tests/all.sh @@ -155,6 +155,8 @@ function printElapsedTime() { } function assertExecutionTime() { + local MAX_TIME + MAX_TIME=$(echo "$ZABBIX_TIMEOUT * 1000" | bc) assertTrue "The script worked for too long" "[ $ELAPSED_TIME -lt $MAX_TIME ]" } @@ -739,7 +741,6 @@ testDiscoverScriptRunDuration() { DATA=$(sudo -u zabbix sudo "/etc/zabbix/zabbix_php_fpm_discovery.sh" "debug" "sleep" "/php-fpm-status") CHECK_OK_COUNT=$(echo "$DATA" | grep -o -F "execution time OK" | wc -l) STOP_OK_COUNT=$(echo "$DATA" | grep -o -F "stop required" | wc -l) - MAX_TIME=$(echo "$ZABBIX_TIMEOUT * 1000" | bc) printElapsedTime printYellow "Success time checks: $CHECK_OK_COUNT" @@ -754,7 +755,6 @@ testZabbixDiscoverRunDuration() { AddSleepToConfig DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["/php-fpm-status"]) - MAX_TIME=$(echo "$ZABBIX_TIMEOUT * 1000" | bc) printElapsedTime assertExecutionTime