diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-11-12 11:24:52 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-11-12 11:24:52 +0100 |
commit | 20f1c9c502beadcc5c6e549c31795e538484ec4f (patch) | |
tree | 4b8d46739e02dbbae64e0d2e7fa0b643642a3f89 | |
parent | 09ed2f1a7a3d28400ce0a0e94ef00e0bb26883fd (diff) | |
download | rsyslog-20f1c9c502beadcc5c6e549c31795e538484ec4f.tar.gz rsyslog-20f1c9c502beadcc5c6e549c31795e538484ec4f.tar.xz rsyslog-20f1c9c502beadcc5c6e549c31795e538484ec4f.zip |
improved testbench: added tests for UDP forwarding and omudpspoof
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | tests/Makefile.am | 19 | ||||
-rwxr-xr-x | tests/sndrcv_omudpspoof.sh | 10 | ||||
-rwxr-xr-x | tests/sndrcv_omudpspoof_nonstdpt.sh | 10 | ||||
-rwxr-xr-x | tests/sndrcv_udp.sh | 10 | ||||
-rwxr-xr-x | tests/sndrcv_udp_nonstdpt.sh | 10 | ||||
-rw-r--r-- | tests/testsuites/sndrcv_omudpspoof_nonstdpt_rcvr.conf | 11 | ||||
-rw-r--r-- | tests/testsuites/sndrcv_omudpspoof_nonstdpt_sender.conf | 18 | ||||
-rw-r--r-- | tests/testsuites/sndrcv_omudpspoof_rcvr.conf | 11 | ||||
-rw-r--r-- | tests/testsuites/sndrcv_omudpspoof_sender.conf | 17 | ||||
-rw-r--r-- | tests/testsuites/sndrcv_sender.conf | 1 | ||||
-rw-r--r-- | tests/testsuites/sndrcv_udp_nonstdpt_rcvr.conf | 11 | ||||
-rw-r--r-- | tests/testsuites/sndrcv_udp_nonstdpt_sender.conf | 9 | ||||
-rw-r--r-- | tests/testsuites/sndrcv_udp_rcvr.conf | 11 | ||||
-rw-r--r-- | tests/testsuites/sndrcv_udp_sender.conf | 9 |
15 files changed, 158 insertions, 0 deletions
@@ -8,6 +8,7 @@ Version 5.3.5 [DEVEL] (rgerhards), 2009-11-?? this was a regression from the omfile rewrite in 4.5.0 * bugfix(testbench): sequence check was not always performed correctly, that could result in tests reporting success when they actually failed +- improved testbench: added tests for UDP forwarding and omudpspoof - doc bugfix: omudpspoof had wrong config command names ("om" missing) - [inport v4] improved testbench, contains now tcp and gzip test cases - [import v4] added a so-called "On Demand Debug" mode, in which debug diff --git a/tests/Makefile.am b/tests/Makefile.am index f8e39bcc..24ad3f9a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -15,9 +15,16 @@ TESTS = $(TESTRUNS) cfg.sh \ rsf_getenv.sh \ sndrcv.sh \ sndrcv_gzip.sh \ + sndrcv_udp.sh \ + sndrcv_udp_nonstdpt.sh \ queue-persist.sh \ pipeaction.sh +if ENABLE_OMUDPSPOOF +TESTS += sndrcv_omudpspoof.sh \ + sndrcv_omudpspoof_nonstdpt.sh +endif + if ENABLE_OMSTDOUT TESTS += omod-if-array.sh \ proprepltest.sh \ @@ -150,6 +157,18 @@ EXTRA_DIST= 1.rstest 2.rstest 3.rstest err1.rstest \ sndrcv.sh \ testsuites/sndrcv_sender.conf \ testsuites/sndrcv_rcvr.conf \ + sndrcv_udp.sh \ + testsuites/sndrcv_udp_sender.conf \ + testsuites/sndrcv_udp_rcvr.conf \ + sndrcv_udp_nonstdpt.sh \ + testsuites/sndrcv_udp_nonstdpt_sender.conf \ + testsuites/sndrcv_udp_nonstdpt_rcvr.conf \ + sndrcv_omudpspoof.sh \ + testsuites/sndrcv_omudpspoof_sender.conf \ + testsuites/sndrcv_omudpspoof_rcvr.conf \ + sndrcv_omudpspoof_nonstdpt.sh \ + testsuites/sndrcv_omudpspoof_nonstdpt_sender.conf \ + testsuites/sndrcv_omudpspoof_nonstdpt_rcvr.conf \ sndrcv_gzip.sh \ testsuites/sndrcv_gzip_sender.conf \ testsuites/sndrcv_gzip_rcvr.conf \ diff --git a/tests/sndrcv_omudpspoof.sh b/tests/sndrcv_omudpspoof.sh new file mode 100755 index 00000000..bb804d93 --- /dev/null +++ b/tests/sndrcv_omudpspoof.sh @@ -0,0 +1,10 @@ +# This runs sends and receives messages via UDP to the standard +# ports. Note that with UDP we can always have message loss. While this is +# less likely in a local environment, we strongly limit the amount of data +# we send in the hope to not lose any messages. However, failure of this +# test does not necessarily mean that the code is wrong (but it is very likely!) +# added 2009-11-11 by Rgerhards +# This file is part of the rsyslog project, released under GPLv3 +echo =============================================================================== +echo \[sndrcv_omudpspoof.sh\]: testing sending and receiving via omudp +source $srcdir/sndrcv_drvr.sh sndrcv_omudpspoof 50 diff --git a/tests/sndrcv_omudpspoof_nonstdpt.sh b/tests/sndrcv_omudpspoof_nonstdpt.sh new file mode 100755 index 00000000..6aeb1a5f --- /dev/null +++ b/tests/sndrcv_omudpspoof_nonstdpt.sh @@ -0,0 +1,10 @@ +# This runs sends and receives messages via UDP to the standard +# ports. Note that with UDP we can always have message loss. While this is +# less likely in a local environment, we strongly limit the amount of data +# we send in the hope to not lose any messages. However, failure of this +# test does not necessarily mean that the code is wrong (but it is very likely!) +# added 2009-11-11 by Rgerhards +# This file is part of the rsyslog project, released under GPLv3 +echo =============================================================================== +echo \[sndrcv_omudpspoof_nonstdpt.sh\]: testing sending and receiving via omudp +source $srcdir/sndrcv_drvr.sh sndrcv_omudpspoof_nonstdpt 50 diff --git a/tests/sndrcv_udp.sh b/tests/sndrcv_udp.sh new file mode 100755 index 00000000..274a414a --- /dev/null +++ b/tests/sndrcv_udp.sh @@ -0,0 +1,10 @@ +# This runs sends and receives messages via UDP to the standard +# ports. Note that with UDP we can always have message loss. While this is +# less likely in a local environment, we strongly limit the amount of data +# we send in the hope to not lose any messages. However, failure of this +# test does not necessarily mean that the code is wrong (but it is very likely!) +# added 2009-11-11 by Rgerhards +# This file is part of the rsyslog project, released under GPLv3 +echo =============================================================================== +echo \[sndrcv_udp.sh\]: testing sending and receiving via udp +source $srcdir/sndrcv_drvr.sh sndrcv_udp 50 diff --git a/tests/sndrcv_udp_nonstdpt.sh b/tests/sndrcv_udp_nonstdpt.sh new file mode 100755 index 00000000..2ad2906f --- /dev/null +++ b/tests/sndrcv_udp_nonstdpt.sh @@ -0,0 +1,10 @@ +# This runs sends and receives messages via UDP to the non-standard port 2514 +# Note that with UDP we can always have message loss. While this is +# less likely in a local environment, we strongly limit the amount of data +# we send in the hope to not lose any messages. However, failure of this +# test does not necessarily mean that the code is wrong (but it is very likely!) +# added 2009-11-11 by Rgerhards +# This file is part of the rsyslog project, released under GPLv3 +echo =============================================================================== +echo \[sndrcv_udp_nonstdpt.sh\]: testing sending and receiving via udp +source $srcdir/sndrcv_drvr.sh sndrcv_udp_nonstdpt 50 diff --git a/tests/testsuites/sndrcv_omudpspoof_nonstdpt_rcvr.conf b/tests/testsuites/sndrcv_omudpspoof_nonstdpt_rcvr.conf new file mode 100644 index 00000000..65659f00 --- /dev/null +++ b/tests/testsuites/sndrcv_omudpspoof_nonstdpt_rcvr.conf @@ -0,0 +1,11 @@ +# see equally-named shell file for details +# rgerhards, 2009-11-12 +$IncludeConfig diag-common.conf + +$ModLoad ../plugins/imudp/.libs/imudp +# then SENDER sends to this port (not tcpflood!) +$UDPServerRun 2514 + +$template outfmt,"%msg:F,58:2%\n" +$template dynfile,"rsyslog.out.log" # trick to use relative path names! +:msg, contains, "msgnum:" ?dynfile;outfmt diff --git a/tests/testsuites/sndrcv_omudpspoof_nonstdpt_sender.conf b/tests/testsuites/sndrcv_omudpspoof_nonstdpt_sender.conf new file mode 100644 index 00000000..29a30145 --- /dev/null +++ b/tests/testsuites/sndrcv_omudpspoof_nonstdpt_sender.conf @@ -0,0 +1,18 @@ +# see equally-named shell file for details +# rgerhards, 2009-11-11 +$IncludeConfig diag-common2.conf + +$ModLoad ../plugins/imtcp/.libs/imtcp +# this listener is for message generation by the test framework! +$InputTCPServerRun 13514 + +$ModLoad ../plugins/omudpspoof/.libs/omudpspoof +$template spoofaddr,"127.0.0.1" + +#begin action definition +$ActionOMUDPSpoofSourceNameTemplate spoofaddr +$ActionOMUDPSpoofTargetHost 127.0.0.1 +$ActionOMUDPSpoofTargetPort 2514 +$ActionOMUDPSpoofSourcePortStart 514 +$ActionOMUDPSpoofSourcePortEnd 514 +*.* :omudpspoof: diff --git a/tests/testsuites/sndrcv_omudpspoof_rcvr.conf b/tests/testsuites/sndrcv_omudpspoof_rcvr.conf new file mode 100644 index 00000000..e5401811 --- /dev/null +++ b/tests/testsuites/sndrcv_omudpspoof_rcvr.conf @@ -0,0 +1,11 @@ +# see equally-named shell file for details +# rgerhards, 2009-11-12 +$IncludeConfig diag-common.conf + +$ModLoad ../plugins/imudp/.libs/imudp +# then SENDER sends to this port (not tcpflood!) +$UDPServerRun 514 + +$template outfmt,"%msg:F,58:2%\n" +$template dynfile,"rsyslog.out.log" # trick to use relative path names! +:msg, contains, "msgnum:" ?dynfile;outfmt diff --git a/tests/testsuites/sndrcv_omudpspoof_sender.conf b/tests/testsuites/sndrcv_omudpspoof_sender.conf new file mode 100644 index 00000000..c0d25935 --- /dev/null +++ b/tests/testsuites/sndrcv_omudpspoof_sender.conf @@ -0,0 +1,17 @@ +# see equally-named shell file for details +# rgerhards, 2009-11-11 +$IncludeConfig diag-common2.conf + +$ModLoad ../plugins/imtcp/.libs/imtcp +# this listener is for message generation by the test framework! +$InputTCPServerRun 13514 + +$ModLoad ../plugins/omudpspoof/.libs/omudpspoof +$template spoofaddr,"127.0.0.1" + +#begin action definition +$ActionOMUDPSpoofSourceNameTemplate spoofaddr +$ActionOMUDPSpoofTargetHost 127.0.0.1 +$ActionOMUDPSpoofSourcePortStart 514 +$ActionOMUDPSpoofSourcePortEnd 514 +*.* :omudpspoof: diff --git a/tests/testsuites/sndrcv_sender.conf b/tests/testsuites/sndrcv_sender.conf index c874c068..f3d6ba53 100644 --- a/tests/testsuites/sndrcv_sender.conf +++ b/tests/testsuites/sndrcv_sender.conf @@ -3,6 +3,7 @@ $IncludeConfig diag-common2.conf $ModLoad ../plugins/imtcp/.libs/imtcp +# this listener is for message generation by the test framework! $InputTCPServerRun 13514 *.* @@127.0.0.1:13515 diff --git a/tests/testsuites/sndrcv_udp_nonstdpt_rcvr.conf b/tests/testsuites/sndrcv_udp_nonstdpt_rcvr.conf new file mode 100644 index 00000000..65659f00 --- /dev/null +++ b/tests/testsuites/sndrcv_udp_nonstdpt_rcvr.conf @@ -0,0 +1,11 @@ +# see equally-named shell file for details +# rgerhards, 2009-11-12 +$IncludeConfig diag-common.conf + +$ModLoad ../plugins/imudp/.libs/imudp +# then SENDER sends to this port (not tcpflood!) +$UDPServerRun 2514 + +$template outfmt,"%msg:F,58:2%\n" +$template dynfile,"rsyslog.out.log" # trick to use relative path names! +:msg, contains, "msgnum:" ?dynfile;outfmt diff --git a/tests/testsuites/sndrcv_udp_nonstdpt_sender.conf b/tests/testsuites/sndrcv_udp_nonstdpt_sender.conf new file mode 100644 index 00000000..2975f938 --- /dev/null +++ b/tests/testsuites/sndrcv_udp_nonstdpt_sender.conf @@ -0,0 +1,9 @@ +# see equally-named shell file for details +# rgerhards, 2009-11-11 +$IncludeConfig diag-common2.conf + +$ModLoad ../plugins/imtcp/.libs/imtcp +# this listener is for message generation by the test framework! +$InputTCPServerRun 13514 + +*.* @127.0.0.1:2514 diff --git a/tests/testsuites/sndrcv_udp_rcvr.conf b/tests/testsuites/sndrcv_udp_rcvr.conf new file mode 100644 index 00000000..e5401811 --- /dev/null +++ b/tests/testsuites/sndrcv_udp_rcvr.conf @@ -0,0 +1,11 @@ +# see equally-named shell file for details +# rgerhards, 2009-11-12 +$IncludeConfig diag-common.conf + +$ModLoad ../plugins/imudp/.libs/imudp +# then SENDER sends to this port (not tcpflood!) +$UDPServerRun 514 + +$template outfmt,"%msg:F,58:2%\n" +$template dynfile,"rsyslog.out.log" # trick to use relative path names! +:msg, contains, "msgnum:" ?dynfile;outfmt diff --git a/tests/testsuites/sndrcv_udp_sender.conf b/tests/testsuites/sndrcv_udp_sender.conf new file mode 100644 index 00000000..28e913ef --- /dev/null +++ b/tests/testsuites/sndrcv_udp_sender.conf @@ -0,0 +1,9 @@ +# see equally-named shell file for details +# rgerhards, 2009-11-11 +$IncludeConfig diag-common2.conf + +$ModLoad ../plugins/imtcp/.libs/imtcp +# this listener is for message generation by the test framework! +$InputTCPServerRun 13514 + +*.* @127.0.0.1 |