diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 7 | ||||
-rwxr-xr-x | tests/imtcp-tls-basic.sh | 11 | ||||
-rw-r--r-- | tests/tcpflood.c | 5 |
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 */ |