3
0
mirror of https://github.com/rvalitov/zabbix-php-fpm.git synced 2023-11-05 03:30:27 +01:00

[fix] pools count in tests

This commit is contained in:
Ramil Valitov 2020-07-06 23:12:47 +03:00
parent f6cd5afe41
commit 96a95e833d
No known key found for this signature in database
GPG Key ID: 2AB186DABDFE1914

View File

@ -221,35 +221,40 @@ testZabbixDiscoverNumberOfStaticPools() {
DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["/php-fpm-status"]) 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) NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"static' | wc -l)
PHP_COUNT=$(getNumberOfPHPVersions) 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() { testZabbixDiscoverNumberOfDynamicPools() {
DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["/php-fpm-status"]) 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) NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"dynamic' | wc -l)
PHP_COUNT=$(getNumberOfPHPVersions) 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() { testZabbixDiscoverNumberOfOndemandPools() {
DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["/php-fpm-status"]) 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) NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"ondemand' | wc -l)
PHP_COUNT=$(getNumberOfPHPVersions) 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() { testZabbixDiscoverNumberOfIPPools() {
DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["/php-fpm-status"]) 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) NUMBER_OF_POOLS=$(echo "$DATA" | grep -o -F '{"{#POOLNAME}":"localhost",' | wc -l)
PHP_COUNT=$(getNumberOfPHPVersions) 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() { testZabbixDiscoverNumberOfPortPools() {
DATA=$(zabbix_get -s 127.0.0.1 -p 10050 -k php-fpm.discover["/php-fpm-status"]) 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) 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 #This test should be last in Zabbix tests