From 96a95e833d7c00802f4944ea895bc80df79eb169 Mon Sep 17 00:00:00 2001 From: Ramil Valitov Date: Mon, 6 Jul 2020 23:12:47 +0300 Subject: [PATCH] [fix] pools count in tests --- tests/all.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/all.sh b/tests/all.sh index 91cd010..61f4b2b 100644 --- a/tests/all.sh +++ b/tests/all.sh @@ -221,35 +221,40 @@ testZabbixDiscoverNumberOfStaticPools() { DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["/php-fpm-status"]) NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"static' | wc -l) PHP_COUNT=$(getNumberOfPHPVersions) - assertEquals "Number of pools mismatch" "$PHP_COUNT" "$NUMBER_OF_POOLS" + POOLS_BY_DESIGN=$(echo "$PHP_COUNT * $MAX_POOLS" | bc) + assertEquals "Number of pools mismatch" "$POOLS_BY_DESIGN" "$NUMBER_OF_POOLS" } testZabbixDiscoverNumberOfDynamicPools() { DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["/php-fpm-status"]) NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"dynamic' | wc -l) PHP_COUNT=$(getNumberOfPHPVersions) - assertEquals "Number of pools mismatch" "$PHP_COUNT" "$NUMBER_OF_POOLS" + POOLS_BY_DESIGN=$(echo "$PHP_COUNT * $MAX_POOLS" | bc) + assertEquals "Number of pools mismatch" "$POOLS_BY_DESIGN" "$NUMBER_OF_POOLS" } testZabbixDiscoverNumberOfOndemandPools() { DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["/php-fpm-status"]) NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"ondemand' | wc -l) PHP_COUNT=$(getNumberOfPHPVersions) - assertEquals "Number of pools mismatch" "$PHP_COUNT" "$NUMBER_OF_POOLS" + POOLS_BY_DESIGN=$(echo "$PHP_COUNT * $MAX_POOLS" | bc) + assertEquals "Number of pools mismatch" "$POOLS_BY_DESIGN" "$NUMBER_OF_POOLS" } testZabbixDiscoverNumberOfIPPools() { DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["/php-fpm-status"]) NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"localhost",' | wc -l) PHP_COUNT=$(getNumberOfPHPVersions) - assertEquals "Number of pools mismatch" "$PHP_COUNT" "$NUMBER_OF_POOLS" + POOLS_BY_DESIGN=$(echo "$PHP_COUNT * $MAX_POOLS" | bc) + assertEquals "Number of pools mismatch" "$POOLS_BY_DESIGN" "$NUMBER_OF_POOLS" } testZabbixDiscoverNumberOfPortPools() { DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["/php-fpm-status"]) - NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"port1",' | wc -l) + NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"port' | wc -l) PHP_COUNT=$(getNumberOfPHPVersions) - assertEquals "Number of pools mismatch" "$PHP_COUNT" "$NUMBER_OF_POOLS" + POOLS_BY_DESIGN=$(echo "$PHP_COUNT * $MAX_POOLS" | bc) + assertEquals "Number of pools mismatch" "$POOLS_BY_DESIGN" "$NUMBER_OF_POOLS" } #This test should be last in Zabbix tests