summaryrefslogtreecommitdiffstats
path: root/tests/imkafka-config-err-param.sh
blob: 107a116ba308b00d0a7f7872a683bb3fd77a5743 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
# added 2018-08-29 by alorbach
# This file is part of the rsyslog project, released under ASL 2.0
. ${srcdir:=.}/diag.sh init
check_command_available kafkacat
export KEEP_KAFKA_RUNNING="YES"

export TESTMESSAGES=1000
# Set EXTRA_EXITCHECK to dump kafka/zookeeperlogfiles on failure only.
export EXTRA_EXITCHECK=dumpkafkalogs
export EXTRA_EXIT=kafka

export RANDTOPIC=$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 8 | head -n 1)

download_kafka
stop_zookeeper
stop_kafka
start_zookeeper
start_kafka

export RSYSLOG_DEBUGLOG="log"
generate_conf
add_conf '
main_queue(queue.timeoutactioncompletion="60000" queue.timeoutshutdown="60000")

module(load="../plugins/imkafka/.libs/imkafka")
/* Polls messages from kafka server!*/
input(	type="imkafka"
	topic="'$RANDTOPIC'"
	broker="localhost:29092"
	consumergroup="default"
	confParam=[ "does.not.exist=none",
		"session.timeout.ms=10000",
		"socket.timeout.ms=5000",
		"socket.keepalive.enable=true",
		"reconnect.backoff.jitter.ms=1000",
		"enable.partition.eof=false" ]
	)

template(name="outfmt" type="string" string="%msg:F,58:2%\n")

action( type="omfile" file="'$RSYSLOG_OUT_LOG'")
'

startup

# We inject messages, even though we know this will not work. The reason
# is that we want to ensure we do not get a segfault in such an error case
injectmsg_kafkacat

shutdown_when_empty
wait_shutdown

content_check "error setting custom configuration parameter 'does.not.exist=none'"
delete_kafka_topic $RANDTOPIC '.dep_wrk' '22181'

exit_test