diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:48:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 11:48:22 +0000 |
commit | 7373ce3d6988706388f136e1c06afd20a3e8d5be (patch) | |
tree | e9ae5af7d102667e5706187646db45de8238e8c4 /config_test/run_tests | |
parent | Initial commit. (diff) | |
download | monitoring-plugins-upstream.tar.xz monitoring-plugins-upstream.zip |
Adding upstream version 2.3.5.upstream/2.3.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'config_test/run_tests')
-rwxr-xr-x | config_test/run_tests | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/config_test/run_tests b/config_test/run_tests new file mode 100755 index 0000000..e7db3ca --- /dev/null +++ b/config_test/run_tests @@ -0,0 +1,30 @@ +#!/bin/ksh +# $1 is the number of iterations to run +# If $2 is specified, this is the number of times you run each iteration +# If there is a fail at run, exit 1 +# Prints to stdout # of successes and passes +# Prints to stderr a dot for each run + +total_runs=$2 +[[ -z $total_runs ]] && total_runs=1 +run=1 +while [[ $run -le $total_runs ]] ; do + i=0 + success=0 + fail=0 + while [[ $i -lt $1 ]] ; do + ./child_test + if [[ $? -eq 0 ]] ; then + success=$(($success+1)) + else + fail=$((fail+1)) + fi + i=$(($i+1)) + done + print "Success=$success Fail=$fail" + [[ $fail -gt 0 ]] && exit 1 + run=$(($run+1)) + [[ $total_runs -gt 1 ]] && print -u2 -n "." +done +[[ $total_runs -gt 1 ]] && print -u2 +exit 0 |