-
Notifications
You must be signed in to change notification settings - Fork 649
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
923 additions
and
15 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
# add 2016-11-22 by Jan Gerhards, released under ASL 2.0 | ||
. $srcdir/diag.sh init | ||
. $srcdir/diag.sh generate-conf | ||
. $srcdir/diag.sh add-conf ' | ||
template(name="outfmt" type="string" string="%msg%\n") | ||
module(load="../plugins/mmanon/.libs/mmanon") | ||
module(load="../plugins/imtcp/.libs/imtcp") | ||
input(type="imtcp" port="13514" ruleset="testing") | ||
ruleset(name="testing") { | ||
action(type="mmanon" ipv4.enable="on" ipv4.mode="zero" ipv4.bits="32" ipv6.bits="128" ipv6.anonmode="zero" ipv6.enable="on") | ||
action(type="omfile" file="rsyslog.out.log" template="outfmt") | ||
}' | ||
|
||
. $srcdir/diag.sh startup | ||
. $srcdir/diag.sh tcpflood -m1 -M "\"<129>Mar 10 01:00:00 172.20.245.8 tag: FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: 1.1.1.8 space 61:34:ad::7:F | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: 111.1.1.8 | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: abf:3:002::500F:ce 1.1.1.9\"" | ||
|
||
. $srcdir/diag.sh shutdown-when-empty | ||
. $srcdir/diag.sh wait-shutdown | ||
echo ' 0:0:0:0:0:0:0:0 | ||
0.0.0.0 space 0:0:0:0:0:0:0:0 | ||
0.0.0.0 | ||
0:0:0:0:0:0:0:0 0.0.0.0' | cmp rsyslog.out.log | ||
if [ ! $? -eq 0 ]; then | ||
echo "invalid response generated, rsyslog.out.log is:" | ||
cat rsyslog.out.log | ||
. $srcdir/diag.sh error-exit 1 | ||
fi; | ||
|
||
. $srcdir/diag.sh exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/bin/bash | ||
# add 2016-11-22 by Jan Gerhards, released under ASL 2.0 | ||
. $srcdir/diag.sh init | ||
. $srcdir/diag.sh generate-conf | ||
. $srcdir/diag.sh add-conf ' | ||
template(name="outfmt" type="string" string="%msg%\n") | ||
template(name="filename" type="string" string="rsyslog.out.%syslogtag%.log") | ||
module(load="../plugins/mmanon/.libs/mmanon") | ||
module(load="../plugins/imtcp/.libs/imtcp") | ||
input(type="imtcp" port="13514" ruleset="testing") | ||
ruleset(name="testing") { | ||
action(type="mmanon" ipv6.anonmode="random" ipv6.bits="128" ipv6.enable="on") | ||
action(type="omfile" dynafile="filename" template="outfmt") | ||
}' | ||
|
||
echo 'Since this test tests randomization, there is a theoretical possibility of it failing even if rsyslog works correctly. Therefore, if the test unexpectedly fails try restarting it.' | ||
. $srcdir/diag.sh startup | ||
. $srcdir/diag.sh tcpflood -m1 -M "\"<129>Mar 10 01:00:00 172.20.245.8 file1 33:45:DDD::4 | ||
<129>Mar 10 01:00:00 172.20.245.8 file2 :: | ||
<129>Mar 10 01:00:00 172.20.245.8 file3 72:8374:adc7:47FF::43:0:1AFE | ||
<129>Mar 10 01:00:00 172.20.245.8 file4 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF | ||
<129>Mar 10 01:00:00 172.20.245.8 file5 72:8374:adc7:47FF::43:0:1AFE\"" | ||
|
||
. $srcdir/diag.sh shutdown-when-empty | ||
. $srcdir/diag.sh wait-shutdown | ||
echo ' 33:45:DDD::4' | cmp rsyslog.out.file1.log >/dev/null | ||
if [ $? -eq 0 ]; then | ||
echo "invalidly equal ip-address generated, rsyslog.out.file1.log is:" | ||
cat rsyslog.out.file1.log | ||
. $srcdir/diag.sh error-exit 1 | ||
fi; | ||
|
||
echo ' ::' | cmp rsyslog.out.file2.log >/dev/null | ||
if [ $? -eq 0 ]; then | ||
echo "invalidly equal ip-address generated, rsyslog.out.file2.log is:" | ||
cat rsyslog.out.file2.log | ||
. $srcdir/diag.sh error-exit 1 | ||
fi; | ||
|
||
echo ' 72:8374:adc7:47FF::43:0:1AFE' | cmp rsyslog.out.file3.log >/dev/null | ||
if [ $? -eq 0 ]; then | ||
echo "invalidly equal ip-address generated, rsyslog.out.file3.log is:" | ||
cat rsyslog.out.file3.log | ||
. $srcdir/diag.sh error-exit 1 | ||
fi; | ||
|
||
echo ' FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF' | cmp rsyslog.out.file4.log >/dev/null | ||
if [ $? -eq 0 ]; then | ||
echo "invalidly equal ip-address generated, rsyslog.out.file4.log is:" | ||
cat rsyslog.out.file4.log | ||
. $srcdir/diag.sh error-exit 1 | ||
fi; | ||
|
||
cmp rsyslog.out.file3.log rsyslog.out.file5.log >/dev/null | ||
if [ $? -eq 0 ]; then | ||
echo "invalidly equal ip-addresses generated, rsyslog.out.file3.log and rsyslog.out.file5.log are:" | ||
cat rsyslog.out.file3.log | ||
cat rsyslog.out.file5.log | ||
. $srcdir/diag.sh error-exit 1 | ||
fi; | ||
|
||
. $srcdir/diag.sh exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#!/bin/bash | ||
# add 2016-11-22 by Jan Gerhards, released under ASL 2.0 | ||
. $srcdir/diag.sh init | ||
. $srcdir/diag.sh generate-conf | ||
. $srcdir/diag.sh add-conf ' | ||
template(name="outfmt" type="string" string="%msg%\n") | ||
template(name="filename" type="string" string="rsyslog.out.%syslogtag%.log") | ||
module(load="../plugins/mmanon/.libs/mmanon") | ||
module(load="../plugins/imtcp/.libs/imtcp") | ||
input(type="imtcp" port="13514" ruleset="testing") | ||
ruleset(name="testing") { | ||
action(type="mmanon" ipv6.anonmode="random-consistent" ipv6.bits="128") | ||
action(type="omfile" dynafile="filename" template="outfmt") | ||
}' | ||
|
||
echo 'Since this test tests randomization, there is a theoretical possibility of it failing even if rsyslog works correctly. Therefore, if the test unexpectedly fails try restarting it.' | ||
. $srcdir/diag.sh startup | ||
. $srcdir/diag.sh tcpflood -m1 -M "\"<129>Mar 10 01:00:00 172.20.245.8 file1 33:45:DDD::4 | ||
<129>Mar 10 01:00:00 172.20.245.8 file2 :: | ||
<129>Mar 10 01:00:00 172.20.245.8 file6 :: | ||
<129>Mar 10 01:00:00 172.20.245.8 file3 72:8374:adc7:47FF::43:0:1AFE | ||
<129>Mar 10 01:00:00 172.20.245.8 file4 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF | ||
<129>Mar 10 01:00:00 172.20.245.8 file5 72:8374:adc7:47FF::43:0:1AFE\"" | ||
|
||
. $srcdir/diag.sh shutdown-when-empty | ||
. $srcdir/diag.sh wait-shutdown | ||
echo ' 33:45:DDD::4' | cmp rsyslog.out.file1.log >/dev/null | ||
if [ $? -eq 0 ]; then | ||
echo "invalidly equal ip-address generated, rsyslog.out.file1.log is:" | ||
cat rsyslog.out.file1.log | ||
. $srcdir/diag.sh error-exit 1 | ||
fi; | ||
|
||
echo ' ::' | cmp rsyslog.out.file2.log >/dev/null | ||
if [ $? -eq 0 ]; then | ||
echo "invalidly equal ip-address generated, rsyslog.out.file2.log is:" | ||
cat rsyslog.out.file2.log | ||
. $srcdir/diag.sh error-exit 1 | ||
fi; | ||
|
||
echo ' 72:8374:adc7:47FF::43:0:1AFE' | cmp rsyslog.out.file3.log >/dev/null | ||
if [ $? -eq 0 ]; then | ||
echo "invalidly equal ip-address generated, rsyslog.out.file3.log is:" | ||
cat rsyslog.out.file3.log | ||
. $srcdir/diag.sh error-exit 1 | ||
fi; | ||
|
||
echo ' FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF' | cmp rsyslog.out.file4.log >/dev/null | ||
if [ $? -eq 0 ]; then | ||
echo "invalidly equal ip-address generated, rsyslog.out.file4.log is:" | ||
cat rsyslog.out.file4.log | ||
. $srcdir/diag.sh error-exit 1 | ||
fi; | ||
|
||
cmp rsyslog.out.file3.log rsyslog.out.file5.log >/dev/null | ||
if [ ! $? -eq 0 ]; then | ||
echo "invalidly unequal ip-addresses generated, rsyslog.out.file1.log and rsyslog.out.file6.log are:" | ||
cat rsyslog.out.file1.log | ||
cat rsyslog.out.file6.log | ||
. $srcdir/diag.sh error-exit 1 | ||
fi; | ||
|
||
cmp rsyslog.out.file2.log rsyslog.out.file6.log >/dev/null | ||
if [ ! $? -eq 0 ]; then | ||
echo "invalidly unequal ip-addresses generated, rsyslog.out.file1.log and rsyslog.out.file6.log are:" | ||
cat rsyslog.out.file1.log | ||
cat rsyslog.out.file6.log | ||
. $srcdir/diag.sh error-exit 1 | ||
fi; | ||
|
||
cmp rsyslog.out.file4.log rsyslog.out.file5.log >/dev/null | ||
if [ $? -eq 0 ]; then | ||
echo "invalidly equal ip-addresses generated, rsyslog.out.file4.log and rsyslog.out.file5.log are:" | ||
cat rsyslog.out.file4.log | ||
cat rsyslog.out.file5.log | ||
. $srcdir/diag.sh error-exit 1 | ||
fi; | ||
|
||
. $srcdir/diag.sh exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
# add 2016-11-22 by Jan Gerhards, released under ASL 2.0 | ||
. $srcdir/diag.sh init | ||
. $srcdir/diag.sh generate-conf | ||
. $srcdir/diag.sh add-conf ' | ||
template(name="outfmt" type="string" string="%msg%\n") | ||
module(load="../plugins/mmanon/.libs/mmanon") | ||
module(load="../plugins/imtcp/.libs/imtcp") | ||
input(type="imtcp" port="13514" ruleset="testing") | ||
ruleset(name="testing") { | ||
action(type="mmanon" ipv4.enable="off" ipv6.enable="on" ipv6.bits="128" ipv6.anonmode="zero") | ||
action(type="omfile" file="rsyslog.out.log" template="outfmt") | ||
}' | ||
|
||
. $srcdir/diag.sh startup | ||
. $srcdir/diag.sh tcpflood -m1 -M "\"<129>Mar 10 01:00:00 172.20.245.8 tag: asdfghjk | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: 61:34:ad::7:F aa:ff43::756:99:0 | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: :: | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: 0:: | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: 13:abd:45: | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: 13:abd:45::. test | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: 13:abd:45::* test | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: *13:abd:45::* test | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: 13:abd:45:* test | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: ewirnwemaa:ff43::756:99:0 | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: a::, cc:: LLL | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: 12:12345::a | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: textnoblank72:8374:adc7:47FF::43:0:1AFE | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: 72:8374:adc7:47FF::43:0:1AFEstillnoblank | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: textnoblank72:8374:adc7:47FF::43:0:1AFEstillnoblank\"" | ||
|
||
. $srcdir/diag.sh shutdown-when-empty | ||
. $srcdir/diag.sh wait-shutdown | ||
echo ' asdfghjk | ||
0:0:0:0:0:0:0:0 | ||
0:0:0:0:0:0:0:0 0:0:0:0:0:0:0:0 | ||
0:0:0:0:0:0:0:0 | ||
0:0:0:0:0:0:0:0 | ||
13:abd:45: | ||
0:0:0:0:0:0:0:0. test | ||
0:0:0:0:0:0:0:0* test | ||
*0:0:0:0:0:0:0:0* test | ||
13:abd:45:* test | ||
ewirnwem0:0:0:0:0:0:0:0 | ||
0:0:0:0:0:0:0:0, 0:0:0:0:0:0:0:0 LLL | ||
12:10:0:0:0:0:0:0:0 | ||
textnoblank0:0:0:0:0:0:0:0 | ||
0:0:0:0:0:0:0:0stillnoblank | ||
textnoblank0:0:0:0:0:0:0:0stillnoblank' | cmp rsyslog.out.log | ||
if [ ! $? -eq 0 ]; then | ||
echo "invalid response generated, rsyslog.out.log is:" | ||
cat rsyslog.out.log | ||
. $srcdir/diag.sh error-exit 1 | ||
fi; | ||
|
||
. $srcdir/diag.sh exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
# add 2016-11-22 by Jan Gerhards, released under ASL 2.0 | ||
. $srcdir/diag.sh init | ||
. $srcdir/diag.sh generate-conf | ||
. $srcdir/diag.sh add-conf ' | ||
template(name="outfmt" type="string" string="%msg%\n") | ||
module(load="../plugins/mmanon/.libs/mmanon") | ||
module(load="../plugins/imtcp/.libs/imtcp") | ||
input(type="imtcp" port="13514" ruleset="testing") | ||
ruleset(name="testing") { | ||
action(type="mmanon" ipv6.bits="129" ipv6.anonmode="zero") | ||
action(type="omfile" file="./rsyslog.out.log" template="outfmt") | ||
} | ||
action(type="omfile" file="rsyslog2.out.log")' | ||
|
||
. $srcdir/diag.sh startup | ||
. $srcdir/diag.sh tcpflood -m1 -M "\"<129>Mar 10 01:00:00 172.20.245.8 tag: asdfghjk | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: 61:34:ad::7:F aa:ff43::756:99:0 | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: :: | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: 0:: | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: 13:abd:45: | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: textnoblank72:8374:adc7:47FF::43:0:1AFEstillnoblank\"" | ||
|
||
. $srcdir/diag.sh shutdown-when-empty | ||
. $srcdir/diag.sh wait-shutdown | ||
echo ' asdfghjk | ||
0:0:0:0:0:0:0:0 | ||
0:0:0:0:0:0:0:0 0:0:0:0:0:0:0:0 | ||
0:0:0:0:0:0:0:0 | ||
0:0:0:0:0:0:0:0 | ||
13:abd:45: | ||
textnoblank0:0:0:0:0:0:0:0stillnoblank' | cmp rsyslog.out.log | ||
if [ ! $? -eq 0 ]; then | ||
echo "invalid response generated, rsyslog.out.log is:" | ||
cat rsyslog.out.log | ||
. $srcdir/diag.sh error-exit 1 | ||
fi; | ||
|
||
|
||
grep 'invalid number of ipv6.bits (129), corrected to 128' rsyslog2.out.log > /dev/null | ||
if [ $? -ne 0 ]; then | ||
echo "invalid correction of bits parameter generated, rsyslog2.out.log is:" | ||
cat rsyslog2.out.log | ||
. $srcdir/diag.sh error-exit 1 | ||
fi; | ||
|
||
. $srcdir/diag.sh exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
# add 2016-11-22 by Jan Gerhards, released under ASL 2.0 | ||
. $srcdir/diag.sh init | ||
. $srcdir/diag.sh generate-conf | ||
. $srcdir/diag.sh add-conf ' | ||
template(name="outfmt" type="string" string="%msg%\n") | ||
module(load="../plugins/mmanon/.libs/mmanon") | ||
module(load="../plugins/imtcp/.libs/imtcp") | ||
input(type="imtcp" port="13514" ruleset="testing") | ||
ruleset(name="testing") { | ||
action(type="mmanon" ipv6.bits="50" ipv6.anonmode="zero") | ||
action(type="omfile" file="./rsyslog.out.log" template="outfmt") | ||
} | ||
action(type="omfile" file="rsyslog2.out.log")' | ||
|
||
. $srcdir/diag.sh startup | ||
. $srcdir/diag.sh tcpflood -m1 -M "\"<129>Mar 10 01:00:00 172.20.245.8 tag: asdfghjk | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: 61:34:ad::7:F aa:ff43::756:99:0 | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: :: | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: 0:: | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: 13:abd:45: | ||
<129>Mar 10 01:00:00 172.20.245.8 tag: textnoblank72:8374:adc7:47FF::43:0:1AFEstillnoblank\"" | ||
|
||
. $srcdir/diag.sh shutdown-when-empty | ||
. $srcdir/diag.sh wait-shutdown | ||
echo ' asdfghjk | ||
ffff:ffff:ffff:ffff:fffc:0:0:0 | ||
61:34:ad:0:0:0:0:0 aa:ff43:0:0:0:0:0:0 | ||
0:0:0:0:0:0:0:0 | ||
0:0:0:0:0:0:0:0 | ||
13:abd:45: | ||
textnoblank72:8374:adc7:47ff:0:0:0:0stillnoblank' | cmp rsyslog.out.log | ||
if [ ! $? -eq 0 ]; then | ||
echo "invalid response generated, rsyslog.out.log is:" | ||
cat rsyslog.out.log | ||
. $srcdir/diag.sh error-exit 1 | ||
fi; | ||
|
||
. $srcdir/diag.sh exit |
Oops, something went wrong.