summaryrefslogtreecommitdiffstats
path: root/tests/no-dynstats-json.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/no-dynstats-json.sh')
-rwxr-xr-xtests/no-dynstats-json.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/no-dynstats-json.sh b/tests/no-dynstats-json.sh
new file mode 100755
index 0000000..245e894
--- /dev/null
+++ b/tests/no-dynstats-json.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+# added 2016-03-10 by singh.janmejay
+# This file is part of the rsyslog project, released under ASL 2.0
+echo ===============================================================================
+echo \[no-dynstats-json.sh\]: test for verifying stats are reported correctly in json format in absence of any dynstats buckets being configured
+. ${srcdir:=.}/diag.sh init
+generate_conf
+add_conf '
+ruleset(name="stats") {
+ action(type="omfile" file="'${RSYSLOG_DYNNAME}'.out.stats.log")
+}
+
+module(load="../plugins/impstats/.libs/impstats" interval="1" severity="7" resetCounters="on" Ruleset="stats" bracketing="on" format="json")
+
+action(type="omfile" file=`echo $RSYSLOG_OUT_LOG`)
+'
+startup
+wait_for_stats_flush ${RSYSLOG_DYNNAME}.out.stats.log
+echo doing shutdown
+shutdown_when_empty
+echo wait on shutdown
+wait_shutdown
+custom_content_check '{ "name": "global", "origin": "dynstats", "values": { } }' "${RSYSLOG_DYNNAME}.out.stats.log"
+exit_test