From ad9435ee39cc6987611435630c52d2259b99a540 Mon Sep 17 00:00:00 2001 From: Ramil Valitov Date: Tue, 7 Jul 2020 00:56:13 +0300 Subject: [PATCH] [fix] discover pools errors --- .travis.yml | 4 ++-- tests/all.sh | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0c967b6..8fea9bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,8 +21,8 @@ jobs: - zabbix-agent before_script: - sudo curl -o /usr/local/bin/shunit2 https://raw.githubusercontent.com/kward/shunit2/master/shunit2 - - sudo apt-get -y purge jq - - sudo apt-get -y purge libfcgi-bin libfcgi0ldbl + - sudo apt-get -y remove jq + - sudo apt-get -y remove libfcgi-bin libfcgi0ldbl - sudo apt autoremove - jq --version script: bash tests/missing.sh diff --git a/tests/all.sh b/tests/all.sh index a84a090..414df01 100644 --- a/tests/all.sh +++ b/tests/all.sh @@ -191,8 +191,9 @@ testDiscoverScriptReturnsData() { testDiscoverScriptDebug() { DATA=$(sudo -u zabbix sudo "/etc/zabbix/zabbix_php_fpm_discovery.sh" "debug" "/php-fpm-status") - ERRORS_LIST=$(echo "$DATA" | grep -F 'Error:') - assertNull "Discover script errors: $DATA" "$ERRORS_LIST" + NUMBER_OF_ERRORS=$(echo "$DATA" | grep -o -F 'Error:' | wc -l) + PHP_COUNT=$(getNumberOfPHPVersions) + assertEquals "Discover script errors: $DATA" "$PHP_COUNT" "$NUMBER_OF_ERRORS" } testZabbixDiscoverReturnsData() {