summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-10-19 13:59:42 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-10-19 13:59:42 +0200
commit2bf008af08cda8bd1b4c712172dd8790f0f8343e (patch)
treed9af9c5aa78047f89709532d242b2c27dd592bdf
parente005c5569c3e0c7c9a098036b7ec3596c3c722b4 (diff)
downloadrsyslog-2bf008af08cda8bd1b4c712172dd8790f0f8343e.tar.gz
rsyslog-2bf008af08cda8bd1b4c712172dd8790f0f8343e.tar.xz
rsyslog-2bf008af08cda8bd1b4c712172dd8790f0f8343e.zip
added new testcase; fixed bug in testdriver
-rw-r--r--runtime/rule.c1
-rw-r--r--tests/nettester.c7
-rw-r--r--tests/testsuites/reallife.parse116
3 files changed, 22 insertions, 2 deletions
diff --git a/runtime/rule.c b/runtime/rule.c
index 182d616a..fe2cf432 100644
--- a/runtime/rule.c
+++ b/runtime/rule.c
@@ -138,6 +138,7 @@ shouldProcessThisMessage(rule_t *pRule, msg_t *pMsg, int *bProcessMsg)
}
}
+RUNLOG_VAR("%p", pRule->pCSProgNameComp);
if(pRule->pCSProgNameComp != NULL) {
int bInv = 0, bEqv = 0, offset = 0;
if(*(rsCStrGetSzStrNoNULL(pRule->pCSProgNameComp)) == '-') {
diff --git a/tests/nettester.c b/tests/nettester.c
index 2838b919..47e75243 100644
--- a/tests/nettester.c
+++ b/tests/nettester.c
@@ -326,10 +326,13 @@ processTestFile(int fd, char *pszFileName)
ret = 1;
}
+ /* clean up after the try */
+ free(testdata);
+ testdata = NULL;
+ free(expected);
+ expected = NULL;
}
- free(testdata);
- free(expected);
fclose(fp);
return(ret);
}
diff --git a/tests/testsuites/reallife.parse1 b/tests/testsuites/reallife.parse1
new file mode 100644
index 00000000..bcbb7fa8
--- /dev/null
+++ b/tests/testsuites/reallife.parse1
@@ -0,0 +1,16 @@
+# New tests should be added to this file if there is no specific
+# reason for not doing that. Initially, we could only handle one test
+# case per file, but this restriction has been removed some time ago.
+# So it is less troublesome (and easier to overlook) to have all related
+# tests in a single file.
+# This file contains a lot of real-life samples (of course mangled so
+# that they can not be traced back to the original submitter). Note
+# that IP addr 192.0.2.1 is specifically set aside for testing and
+# documentation by IANA.
+# rgerhards, 2009-10-19
+<29>Oct 16 20:47:24 example-p exam-pl[12345]: connect host= /192.0.2.1
+29,daemon,notice,Oct 16 20:47:24,example-p,exam-pl,exam-pl[12345]:, connect host= /192.0.2.1
+<175>Oct 16 23:47:31 #001 MSWinEventLog 0#011Security#01119023582#011Fri Oct 16 16:30:44 2009#011592#011Security#011rgabcde#011User#011Success Audit#011XSXSXSN01#011Detailed Tracking#011#0112572#01119013885
+175,local5,debug,Oct 16 23:47:31,localhost,#001,#001, MSWinEventLog 0#011Security#01119023582#011Fri Oct 16 16:30:44 2009#011592#011Security#011rgabcde#011User#011Success Audit#011XSXSXSN01#011Detailed Tracking#011#0112572#01119013885
+#
+#175,local5,debug,Oct 16 23:47:31,127.0.0.1,#001,#001, MSWinEventLog 0#011Security#01119023582#011Fri Oct 16 16:30:44 2009#011592#011Security#011rgabcde#011User#011Success Audit#011XSXSXSN01#011Detailed Tracking#011#0112572#01119013885