diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-24 09:54:23 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-24 09:54:44 +0000 |
commit | 836b47cb7e99a977c5a23b059ca1d0b5065d310e (patch) | |
tree | 1604da8f482d02effa033c94a84be42bc0c848c3 /fluent-bit/lib/monkey/qa/run_tests.sh | |
parent | Releasing debian version 1.44.3-2. (diff) | |
download | netdata-836b47cb7e99a977c5a23b059ca1d0b5065d310e.tar.xz netdata-836b47cb7e99a977c5a23b059ca1d0b5065d310e.zip |
Merging upstream version 1.46.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'fluent-bit/lib/monkey/qa/run_tests.sh')
-rwxr-xr-x | fluent-bit/lib/monkey/qa/run_tests.sh | 119 |
1 files changed, 0 insertions, 119 deletions
diff --git a/fluent-bit/lib/monkey/qa/run_tests.sh b/fluent-bit/lib/monkey/qa/run_tests.sh deleted file mode 100755 index 4c0b9fa75..000000000 --- a/fluent-bit/lib/monkey/qa/run_tests.sh +++ /dev/null @@ -1,119 +0,0 @@ - -#!/bin/sh -TEST_FILES=`ls *.htt` -TOTAL_TESTS=`echo $TEST_FILES | wc -w` - -# Server parameters file -CONFIG_FILE='__CONFIG' - -LOGFILE='errors.log' - -# Clear log file -:>$LOGFILE - -# Should we stop at the first error? (yes | no) -STOP_AT_ERRORS=no - -# httest error code for 'Connection refused' -CONN_REFUSED=111 - -# Enable colors in output :) (yes | no) -WITH_COLOR=yes - -# httest command -HTTEST_CMD='httest' - -NTEST=1 -TESTS_FAILED=0 -TESTS_OK=0 -TESTS_AVOIDED=0 -CHECKLOGS=0 - -if [ "$1" = "-l" ]; then - CHECKLOGS=1 - TOTAL_TESTS=`expr $TOTAL_TESTS \* 2` -fi - -for test_file in $TEST_FILES; do -# echo -ne "[TEST $NTEST/$TOTAL_TESTS]\t""case: $test_file\t\t" - printf "[%3d/%d] %-32s " $NTEST $TOTAL_TESTS "$test_file" - - OUTPUT=`$HTTEST_CMD "$test_file" 2>&1` - ERRCODE=$? - - case $ERRCODE in - 0) - TESTS_OK=$((TESTS_OK+1)) - [ $WITH_COLOR = yes ] && echo -n "[1;32m" - echo -n "=> [OK]" - [ $WITH_COLOR = yes ] && echo -n "[m" - ;; - - $CONN_REFUSED) - echo - echo "Connection refused... (Is monkey running?)" >&2 - exit $CONN_REFUSED - ;; - - *) - TESTS_FAILED=$((TESTS_FAILED+1)) - [ $WITH_COLOR = yes ] && echo -n "[1;31m" - echo -n "=> [FAILED]" - [ $WITH_COLOR = yes ] && echo -n "[m" - - perl -e 'print "-" x 78, "\n"' >>"$LOGFILE" - echo "$OUTPUT" >>"$LOGFILE" - perl -e 'print "-" x 78, "\n"' >>"$LOGFILE" - - [ $STOP_AT_ERRORS = yes ] && exit 1 - esac - - # Check for logfiles rules - NTEST=$((NTEST+1)) - - if [ $CHECKLOGS = 0 ]; then - echo - continue - fi - - echo - test_file=`echo $test_file | sed 's/\.htt/\.log/g'` - printf "[%3d/%d] %-32s " $NTEST $TOTAL_TESTS "$test_file" - - if [ ! -e "log_rules/$test_file" ]; then - ERRCODE=2 - else - # We need to sleep for a while as Monkey needs to flush - # the logs, that happens every 3 seconds - sleep 2 - CHECKLOG=`./checklog -l log_rules/$test_file` - ERRCODE=$? - fi - - case $ERRCODE in - 0) - [ $WITH_COLOR = yes ] && echo -n "[1;32m" - echo "=> [OK]" - [ $WITH_COLOR = yes ] && echo -n "[m" - TESTS_OK=$((TESTS_OK+1)) - ;; - 1) - [ $WITH_COLOR = yes ] && echo -n "[1;31m" - echo "=> [FAILED]" - echo $CHECKLOG - [ $WITH_COLOR = yes ] && echo -n "[m" - TESTS_FAILED=$((TESTS_FAILED+1)) - [ $STOP_AT_ERRORS = yes ] && exit 1 - ;; - - 2) [ $WITH_COLOR = yes ] && echo -n "[1;33m" - echo "=> [NO RULES]" - [ $WITH_COLOR = yes ] && echo -n "[m" - TESTS_AVOIDED=$((TESTS_AVOIDED+1)) - ;; - esac - - NTEST=$((NTEST+1)) -done - -echo -e "\n$TESTS_OK test(s) succeeded, $TESTS_FAILED test(s) failed, $TESTS_AVOIDED test(s) avoided." |