summaryrefslogtreecommitdiffstats
path: root/tests/key_dereference_on_uninitialized_variable_space.sh
blob: d9c6f4ec16c674030fcaee1191537db1ec64a227 (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
#!/bin/bash
# added 2015-05-27 by singh.janmejay
# This file is part of the rsyslog project, released under ASL 2.0
echo ===============================================================================
echo \[key_dereference_on_uninitialized_variable_space.sh\]: test to dereference key from a not-yet-created cee or local json-object
. ${srcdir:=.}/diag.sh init
generate_conf
add_conf '
template(name="corge" type="string" string="cee:%$!%\n")

module(load="../plugins/imtcp/.libs/imtcp")

ruleset(name="echo") {
  if ($!foo == "bar") then {
    set $!baz = "quux";
  }
  action(type="omfile" file=`echo $RSYSLOG_OUT_LOG` template="corge")
}

input(type="imtcp" port="0" listenPortFileName="'$RSYSLOG_DYNNAME'.tcpflood_port")

call echo
'
startup
tcpflood -m 10
echo doing shutdown
shutdown_when_empty
echo wait on shutdown
wait_shutdown
content_check 'cee:'
exit_test