rsyslog/tests/es-basic-vgthread.sh
Rainer Gerhards cd26aecaf9
tests/omelasticsearch: align suite with ES 7.14, reduce flakiness
Non-technical: test flakiness makes it hard to validate unrelated changes.
This aligns omelasticsearch tests with ES 7.14 defaults to get the
testbench back to a deterministic state and pave the way for further
modernization.

Impact: test behavior changes; one test skipped; CI coverage slightly reduced.

Before: tests mixed ES 6-era types and ad-hoc tarball picks; deprecation
checks intermittently failed and retries were brittle. After: tests use the
7.14.1 tarball via diag.sh default, typeless mappings, and `_doc` type in
omelasticsearch actions; known-flaky bulk-retry test is skipped for now.

Technical details:
- Add `searchType="_doc"` to all omelasticsearch actions and update index
  provisioning to typeless mappings compatible with ES 7.14.
- Remove script-level `ES_DOWNLOAD` overrides to follow diag.sh's 7.14.1
  default, keeping test scripts and helper defaults in sync.
- Drop deprecation-log assertion in `es-searchType-empty.sh` to prevent
  spurious failures specific to ES 6-era types.
- Temporarily skip `es-bulk-retry.sh` (exit 77) pending a rewrite of retry
  semantics under ES 7.x.
- CI: export `VERBOSE=1`; disable Kafka and Elasticsearch tests in the
  affected matrix job to keep CI green while ES/Kafka suites are refactored.
  VERBOSE ensures test logs are emitted to stderr and as such are
  visible in CI test runs.
- Minor whitespace/indent cleanups; no runtime code or plugin behavior
  changes.
2025-09-21 14:09:09 +02:00

34 lines
836 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_PORT=19200
export NUMMESSAGES=5000 # test is pretty slow, so use a low number
export QUEUE_EMPTY_CHECK_FUNC=es_shutdown_empty_check
ensure_elasticsearch_ready
init_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=`echo $ES_PORT`
template="tpl"
searchType="_doc"
searchIndex="rsyslog_testbench")
}
'
startup_vgthread
injectmsg
shutdown_when_empty
wait_shutdown_vg
check_exit_vg
es_getdata
seq_check
exit_test