summaryrefslogtreecommitdiff
path: root/tests/testsuites
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2014-03-13 17:57:11 +0100
committerMichael Biebl <biebl@debian.org>2014-03-13 17:57:11 +0100
commit29867b5cc18d25191fbbdcc4af4f79cc3a4da43e (patch)
tree1ffedd33b2a2e167aeb4b01a6c5c72aeb98a1b90 /tests/testsuites
parent5fccf771f37973a2cea543fbdf1ed94ed9706faf (diff)
downloadrsyslog-29867b5cc18d25191fbbdcc4af4f79cc3a4da43e.tar.gz
Imported Upstream version 7.6.1upstream/7.6.1
Diffstat (limited to 'tests/testsuites')
-rw-r--r--tests/testsuites/mmpstrucdata.conf12
-rw-r--r--tests/testsuites/rfc5424parser.conf10
-rw-r--r--tests/testsuites/rs_optimizer_pri.conf8
-rw-r--r--tests/testsuites/rscript_eq.conf14
-rw-r--r--tests/testsuites/rscript_ge.conf13
-rw-r--r--tests/testsuites/rscript_gt.conf12
-rw-r--r--tests/testsuites/rscript_le.conf12
-rw-r--r--tests/testsuites/rscript_lt.conf12
-rw-r--r--tests/testsuites/rscript_ne.conf18
-rw-r--r--tests/testsuites/stop-localvar.conf8
-rw-r--r--tests/testsuites/stop-msgvar.conf21
11 files changed, 136 insertions, 4 deletions
diff --git a/tests/testsuites/mmpstrucdata.conf b/tests/testsuites/mmpstrucdata.conf
new file mode 100644
index 0000000..fd18fd9
--- /dev/null
+++ b/tests/testsuites/mmpstrucdata.conf
@@ -0,0 +1,12 @@
+$IncludeConfig diag-common.conf
+
+module(load="../plugins/mmpstrucdata/.libs/mmpstrucdata")
+module(load="../plugins/imtcp/.libs/imtcp")
+
+template(name="outfmt" type="string" string="%$!rfc5424-sd!tcpflood@32473!msgnum%\n")
+
+input(type="imtcp" port="13514")
+
+action(type="mmpstrucdata")
+if $msg contains "msgnum" then
+ action(type="omfile" template="outfmt" file="rsyslog.out.log")
diff --git a/tests/testsuites/rfc5424parser.conf b/tests/testsuites/rfc5424parser.conf
new file mode 100644
index 0000000..cd90d12
--- /dev/null
+++ b/tests/testsuites/rfc5424parser.conf
@@ -0,0 +1,10 @@
+$IncludeConfig diag-common.conf
+
+module(load="../plugins/imtcp/.libs/imtcp")
+
+template(name="outfmt" type="string" string="%msg:F,58:2%\n")
+
+input(type="imtcp" port="13514")
+
+if $msg contains "msgnum" then
+ action(type="omfile" template="outfmt" file="rsyslog.out.log")
diff --git a/tests/testsuites/rs_optimizer_pri.conf b/tests/testsuites/rs_optimizer_pri.conf
new file mode 100644
index 0000000..9ff27dc
--- /dev/null
+++ b/tests/testsuites/rs_optimizer_pri.conf
@@ -0,0 +1,8 @@
+$IncludeConfig diag-common.conf
+template(name="outfmt" type="string" string="%msg:F,58:2%\n")
+
+module(load="../plugins/imtcp/.libs/imtcp")
+input(type="imtcp" port="13514")
+
+if $syslogfacility-text == "local4" then
+ action(type="omfile" template="outfmt" file="rsyslog.out.log")
diff --git a/tests/testsuites/rscript_eq.conf b/tests/testsuites/rscript_eq.conf
new file mode 100644
index 0000000..0130aed
--- /dev/null
+++ b/tests/testsuites/rscript_eq.conf
@@ -0,0 +1,14 @@
+$IncludeConfig diag-common.conf
+
+template(name="outfmt" type="list") {
+ property(name="$!usr!msgnum")
+ constant(value="\n")
+}
+
+if $msg contains 'msgnum' then {
+ set $!usr!msgnum = field($msg, 58, 2);
+ if $!usr!msgnum == "00005000" or
+ $!usr!msgnum == "00005001" or
+ $!usr!msgnum == "00005002" then
+ action(type="omfile" file="./rsyslog.out.log" template="outfmt")
+}
diff --git a/tests/testsuites/rscript_ge.conf b/tests/testsuites/rscript_ge.conf
new file mode 100644
index 0000000..c2ff86a
--- /dev/null
+++ b/tests/testsuites/rscript_ge.conf
@@ -0,0 +1,13 @@
+$IncludeConfig diag-common.conf
+
+template(name="outfmt" type="list") {
+ property(name="$!usr!msgnum")
+ constant(value="\n")
+}
+
+if $msg contains 'msgnum' then {
+ set $!usr!msgnum = field($msg, 58, 2);
+ if $!usr!msgnum >= "00005000" then
+ stop
+ action(type="omfile" file="./rsyslog.out.log" template="outfmt")
+}
diff --git a/tests/testsuites/rscript_gt.conf b/tests/testsuites/rscript_gt.conf
new file mode 100644
index 0000000..9a651ad
--- /dev/null
+++ b/tests/testsuites/rscript_gt.conf
@@ -0,0 +1,12 @@
+$IncludeConfig diag-common.conf
+
+template(name="outfmt" type="list") {
+ property(name="$!usr!msgnum")
+ constant(value="\n")
+}
+
+if $msg contains 'msgnum' then {
+ set $!usr!msgnum = field($msg, 58, 2);
+ if $!usr!msgnum > "00004999" then
+ action(type="omfile" file="./rsyslog.out.log" template="outfmt")
+}
diff --git a/tests/testsuites/rscript_le.conf b/tests/testsuites/rscript_le.conf
new file mode 100644
index 0000000..1963cc5
--- /dev/null
+++ b/tests/testsuites/rscript_le.conf
@@ -0,0 +1,12 @@
+$IncludeConfig diag-common.conf
+
+template(name="outfmt" type="list") {
+ property(name="$!usr!msgnum")
+ constant(value="\n")
+}
+
+if $msg contains 'msgnum' then {
+ set $!usr!msgnum = field($msg, 58, 2);
+ if $!usr!msgnum <= "00005000" then
+ action(type="omfile" file="./rsyslog.out.log" template="outfmt")
+}
diff --git a/tests/testsuites/rscript_lt.conf b/tests/testsuites/rscript_lt.conf
new file mode 100644
index 0000000..1f455ec
--- /dev/null
+++ b/tests/testsuites/rscript_lt.conf
@@ -0,0 +1,12 @@
+$IncludeConfig diag-common.conf
+
+template(name="outfmt" type="list") {
+ property(name="$!usr!msgnum")
+ constant(value="\n")
+}
+
+if $msg contains 'msgnum' then {
+ set $!usr!msgnum = field($msg, 58, 2);
+ if $!usr!msgnum < "00005000" then
+ action(type="omfile" file="./rsyslog.out.log" template="outfmt")
+}
diff --git a/tests/testsuites/rscript_ne.conf b/tests/testsuites/rscript_ne.conf
new file mode 100644
index 0000000..43148ca
--- /dev/null
+++ b/tests/testsuites/rscript_ne.conf
@@ -0,0 +1,18 @@
+$IncludeConfig diag-common.conf
+
+template(name="outfmt" type="list") {
+ property(name="$!usr!msgnum")
+ constant(value="\n")
+}
+
+if $msg contains 'msgnum' then {
+ set $!usr!msgnum = field($msg, 58, 2);
+ if $!usr!msgnum != "00005000" and
+ $!usr!msgnum != "00005001" and
+ $!usr!msgnum != "00005002" then
+ set $!usr!write = 0;
+ else
+ set $!usr!write = 1;
+ if $!usr!write == 1 then
+ action(type="omfile" file="./rsyslog.out.log" template="outfmt")
+}
diff --git a/tests/testsuites/stop-localvar.conf b/tests/testsuites/stop-localvar.conf
index 020ebd8..63df650 100644
--- a/tests/testsuites/stop-localvar.conf
+++ b/tests/testsuites/stop-localvar.conf
@@ -5,17 +5,17 @@
* rgerhards, 2013-11-19
*/
$IncludeConfig diag-common.conf
-template(name="outfmt" type="string" string="%$!nbr%\n")
+template(name="outfmt" type="string" string="%$.nbr%\n")
module(load="../plugins/imtcp/.libs/imtcp")
input(type="imtcp" port="13514")
if $msg contains "msgnum:" then {
- set $!nbr = field($msg, 58, 2);
- if cnum($!nbr) < 100 then
+ set $.nbr = field($msg, 58, 2);
+ if cnum($.nbr) < 100 then
stop
/* check is intentionally more complex than needed! */
- else if not (cnum($!nbr) > 999) then {
+ else if not (cnum($.nbr) > 999) then {
action(type="omfile" file="rsyslog.out.log" template="outfmt")
}
}
diff --git a/tests/testsuites/stop-msgvar.conf b/tests/testsuites/stop-msgvar.conf
new file mode 100644
index 0000000..020ebd8
--- /dev/null
+++ b/tests/testsuites/stop-msgvar.conf
@@ -0,0 +1,21 @@
+/* note: variables are strings (at least in v7), so we need to convert
+ * to a number when we check the conditon.
+ * Even if we change the variable representation at some later point,
+ * we should NOT change this test here, but better add a new one.
+ * rgerhards, 2013-11-19
+ */
+$IncludeConfig diag-common.conf
+template(name="outfmt" type="string" string="%$!nbr%\n")
+
+module(load="../plugins/imtcp/.libs/imtcp")
+input(type="imtcp" port="13514")
+
+if $msg contains "msgnum:" then {
+ set $!nbr = field($msg, 58, 2);
+ if cnum($!nbr) < 100 then
+ stop
+ /* check is intentionally more complex than needed! */
+ else if not (cnum($!nbr) > 999) then {
+ action(type="omfile" file="rsyslog.out.log" template="outfmt")
+ }
+}