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

[add] test missing packages

This commit is contained in:
Ramil Valitov 2020-07-06 00:18:23 +03:00
parent 33d34892c7
commit 42d405ce2a
No known key found for this signature in database
GPG Key ID: 2AB186DABDFE1914

View File

@ -226,7 +226,7 @@ testZabbixDiscoverNumberOfPortPools() {
assertEquals "Number of pools mismatch" "$PHP_COUNT" "$NUMBER_OF_POOLS" assertEquals "Number of pools mismatch" "$PHP_COUNT" "$NUMBER_OF_POOLS"
} }
#This test should be last #This test should be last in Zabbix tests
testZabbixDiscoverTimeout() { testZabbixDiscoverTimeout() {
#Create lots of pools #Create lots of pools
MAX_POOLS=100 MAX_POOLS=100
@ -236,5 +236,25 @@ testZabbixDiscoverTimeout() {
testZabbixDiscoverReturnsData testZabbixDiscoverReturnsData
} }
#################################
#The following tests should be last, no tests of actual data should be done afterwards
testMissingPackagesDiscoveryScript() {
sudo apt-get -y purge jq
DATA=$(sudo bash "/etc/zabbix/zabbix_php_fpm_discovery.sh" "/php-fpm-status")
IS_OK=$(echo "$DATA" | grep -F ' not found.')
assertNotNull "Discovery script didn't report error on missing utility 'jq'"
}
testMissingPackagesStatusScript() {
sudo apt-get -y purge libfcgi-bin libfcgi0ldbl
PHP_POOL=$(getAnySocket)
DATA=$(sudo bash "/etc/zabbix/zabbix_php_fpm_status.sh" "$PHP_POOL" "/php-fpm-status")
IS_OK=$(echo "$DATA" | grep -F ' not found.')
assertNotNull "Status script didn't report error on missing utility 'cgi-fcgi'"
}
# Load shUnit2. # Load shUnit2.
. shunit2 . shunit2