rsyslog/tests/es-basic-ha-vg.sh
Rainer Gerhards 9cf9f2e8b7 testbench: change elasticsearch tests to use new plumbing
This makes the ES tests more universally available (they should now
also support running in containers). It also simplifies the tests
as fewer support files are needed.
2018-06-18 17:12:08 +02:00

34 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# This file is part of the rsyslog project, released under ASL 2.0
export ES_DOWNLOAD=elasticsearch-6.0.0.tar.gz
export ES_PORT=19200
. $srcdir/diag.sh download-elasticsearch
. $srcdir/diag.sh stop-elasticsearch
. $srcdir/diag.sh prepare-elasticsearch
. $srcdir/diag.sh start-elasticsearch
. $srcdir/diag.sh init
. $srcdir/diag.sh es-init
. $srcdir/diag.sh generate-conf
. $srcdir/diag.sh add-conf '
template(name="tpl" type="string"
string="{\"msgnum\":\"%msg:F,58:2%\"}")
module(load="../plugins/omelasticsearch/.libs/omelasticsearch")
:msg, contains, "msgnum:" action(type="omelasticsearch"
template="tpl"
serverport=`echo $ES_PORT`
searchIndex="rsyslog_testbench"
bulkmode="on")
'
. $srcdir/diag.sh startup-vg
. $srcdir/diag.sh injectmsg 0 100
. $srcdir/diag.sh wait-queueempty
. $srcdir/diag.sh shutdown-when-empty
. $srcdir/diag.sh wait-shutdown-vg
. $srcdir/diag.sh es-getdata 100 $ES_PORT
. $srcdir/diag.sh seq-check 0 99
. $srcdir/diag.sh stop-elasticsearch
. $srcdir/diag.sh cleanup-elasticsearch
. $srcdir/diag.sh exit