summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-02-28 17:28:07 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2011-02-28 17:28:07 +0100
commit9be853a2c8d0fd7fdc415200af57493ad5a00feb (patch)
treee7bd63bd8dc7540488be93d0c3a84b74eeb32831 /tests
parent34cf945d034cbd3ef2331f378842bb21478ce7be (diff)
downloadrsyslog-9be853a2c8d0fd7fdc415200af57493ad5a00feb.tar.gz
rsyslog-9be853a2c8d0fd7fdc415200af57493ad5a00feb.tar.xz
rsyslog-9be853a2c8d0fd7fdc415200af57493ad5a00feb.zip
added new tls-based test to testbench
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am7
-rwxr-xr-xtests/imtcp-tls-basic.sh11
-rw-r--r--tests/tcpflood.c5
3 files changed, 21 insertions, 2 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index ec1b0813..9bf33938 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -57,6 +57,11 @@ TESTS += \
imptcp_conndrop.sh
endif
+if ENABLE_GNUTLS
+TESTS += \
+ imtcp-tls-basic.sh
+endif
+
if ENABLE_OMUXSOCK
TESTS += uxsock_simple.sh
endif
@@ -194,6 +199,8 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \
testsuites/da-mainmsg-q.conf \
diskqueue-fsync.sh \
testsuites/diskqueue-fsync.conf \
+ imtcp-tls-basic.sh \
+ testsuites/imtcp-tls-basic.conf \
imtcp-multiport.sh \
testsuites/imtcp-multiport.conf \
manytcp.sh \
diff --git a/tests/imtcp-tls-basic.sh b/tests/imtcp-tls-basic.sh
new file mode 100755
index 00000000..d00f95d6
--- /dev/null
+++ b/tests/imtcp-tls-basic.sh
@@ -0,0 +1,11 @@
+# added 2011-02-28 by Rgerhards
+# This file is part of the rsyslog project, released under GPLv3
+echo ===============================================================================
+echo \[imtcp-tls-basic.sh\]: testing imtcp in TLS mode - basic test
+source $srcdir/diag.sh init
+source $srcdir/diag.sh startup imtcp-tls-basic.conf
+source $srcdir/diag.sh tcpflood -p13514 -m50000 -Ttls -Z./tls-certs/cert.pem -z./tls-certs/key.pem
+source $srcdir/diag.sh shutdown-when-empty # shut down rsyslogd when done processing messages
+source $srcdir/diag.sh wait-shutdown
+source $srcdir/diag.sh seq-check 0 49999
+source $srcdir/diag.sh exit
diff --git a/tests/tcpflood.c b/tests/tcpflood.c
index b4f097f9..59c63d23 100644
--- a/tests/tcpflood.c
+++ b/tests/tcpflood.c
@@ -334,7 +334,7 @@ void closeConnections(void)
* of constructing test messages. -- rgerhards, 2010-03-31
*/
static inline void
-genMsg(char *buf, size_t maxBuf, int *pLenBuf)
+genMsg(char *buf, size_t maxBuf, int *pLenBuf, struct instdata *inst)
{
int edLen; /* actual extra data length to use */
char extraData[MAX_EXTRADATA_LEN + 1];
@@ -377,6 +377,7 @@ genMsg(char *buf, size_t maxBuf, int *pLenBuf)
/* use fixed message format from command line */
*pLenBuf = snprintf(buf, maxBuf, "%s\n", MsgToSend);
}
+ ++inst->numSent;
finalize_it: /*EMPTY to keep the compiler happy */;
}
@@ -425,7 +426,7 @@ int sendMessages(struct instdata *inst)
socknum = rnd % numConnections;
}
}
- genMsg(buf, sizeof(buf), &lenBuf); /* generate the message to send according to params */
+ genMsg(buf, sizeof(buf), &lenBuf, inst); /* generate the message to send according to params */
if(transport == TP_TCP) {
if(sockArray[socknum] == -1) {
/* connection was dropped, need to re-establish */