rsyslog/tests/es-basic-es6.0.sh
Rainer Gerhards 6cb60302c5
testbench: improve robustness against slow CI, gen. improvements
* add an overall timeout value for tests - if running longer,
  testbench framework tries to FAIL and end test. Note that
  this is not bullet-proof and not intended to be so.
* guard against hanging rsyslog instances via a new imdiag
  feature to abort after n number of seconds; among others,
  this guards as against timeout-cancel in CI, which is always
  pretty hard to diagnose - now we see these errors in test-suite.log
* fix a bug in tcp zip test, which actually did not use zip mode
* experimnentalls add debug output to better understand
  shutdown_when_empty operation; goal is to improve understanding
  and then remove that code again.
* improve shutdown predicate for a couple of tests
* made travis run make check with two parallel threads, for which
  we seem ready now. Nevertheless, it's still experimental and we
  may roll this back if required.
2018-12-28 13:03:57 +01:00

34 lines
786 B
Bash
Executable File

#!/bin/bash
# This file is part of the rsyslog project, released under ASL 2.0
. ${srcdir:=.}/diag.sh init
export ES_DOWNLOAD=elasticsearch-6.0.0.tar.gz
export ES_PORT=19200
export NUMMESSAGES=2000 # slow test
export QUEUE_EMPTY_CHECK_FUNC=es_shutdown_empty_check
download_elasticsearch
prepare_elasticsearch
start_elasticsearch
generate_conf
add_conf '
template(name="tpl" type="string"
string="{\"msgnum\":\"%msg:F,58:2%\"}")
module(load="../plugins/omelasticsearch/.libs/omelasticsearch")
if $msg contains "msgnum:" then
action(type="omelasticsearch"
server="127.0.0.1"
serverport="19200"
template="tpl"
searchIndex="rsyslog_testbench")
'
startup
injectmsg
shutdown_when_empty
wait_shutdown
es_getdata
seq_check
cleanup_elasticsearch
exit_test