mirror of
https://github.com/rvalitov/zabbix-php-fpm.git
synced 2023-11-05 03:30:27 +01:00
[add] multiple run steps
This commit is contained in:
parent
ff69832d45
commit
6f0bea84df
16
tests/all.sh
16
tests/all.sh
@ -330,13 +330,9 @@ testZabbixDiscoverRunDuration() {
|
|||||||
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"])
|
||||||
END_TIME=$(date +%s%N)
|
END_TIME=$(date +%s%N)
|
||||||
ELAPSED_TIME=$(echo "($END_TIME - $START_TIME)/1000000" | bc)
|
ELAPSED_TIME=$(echo "($END_TIME - $START_TIME)/1000000" | bc)
|
||||||
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)
|
MAX_TIME=$(echo "$ZABBIX_TIMEOUT * 1000" | bc)
|
||||||
|
|
||||||
echo "Elapsed time $ELAPSED_TIME ms"
|
echo "Elapsed time $ELAPSED_TIME ms"
|
||||||
echo "Success time checks: $CHECK_OK_COUNT"
|
|
||||||
echo "Stop time checks: $STOP_OK_COUNT"
|
|
||||||
|
|
||||||
assertTrue "The script worked for too long" "[ $ELAPSED_TIME -lt $MAX_TIME ]"
|
assertTrue "The script worked for too long" "[ $ELAPSED_TIME -lt $MAX_TIME ]"
|
||||||
}
|
}
|
||||||
@ -516,11 +512,19 @@ testZabbixDiscoverManyPools() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
testDiscoverScriptManyPoolsRunDuration() {
|
testDiscoverScriptManyPoolsRunDuration() {
|
||||||
testDiscoverScriptRunDuration
|
MAX_RUNS=5
|
||||||
|
for ((c = 1; c <= MAX_RUNS; c++)); do
|
||||||
|
echo "Run #$c..."
|
||||||
|
testDiscoverScriptRunDuration
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
testZabbixDiscoverManyPoolsRunDuration() {
|
testZabbixDiscoverManyPoolsRunDuration() {
|
||||||
testZabbixDiscoverRunDuration
|
MAX_RUNS=5
|
||||||
|
for ((c = 1; c <= MAX_RUNS; c++)); do
|
||||||
|
echo "Run #$c..."
|
||||||
|
testZabbixDiscoverRunDuration
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Load shUnit2.
|
# Load shUnit2.
|
||||||
|
Loading…
Reference in New Issue
Block a user