Debian Codegraph @

tests/mmanon_random_cons_128_ipv6.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 # add 2016-11-22 by Jan Gerhards, released under ASL 2.0
3 . ${srcdir:=.}/diag.sh init
4 generate_conf
5 add_conf '
6 template(name="outfmt" type="string" string="%msg%\n")
7 template(name="filename" type="string" string="'${RSYSLOG_DYNNAME}'.%syslogtag%.log")
8
9 module(load="../plugins/mmanon/.libs/mmanon")
10 module(load="../plugins/imtcp/.libs/imtcp")
11 input(type="imtcp" port="0" listenPortFileName="'$RSYSLOG_DYNNAME'.tcpflood_port" ruleset="testing")
12
13 ruleset(name="testing") {
14 action(type="mmanon" ipv6.anonmode="random-consistent" ipv6.bits="128")
15 action(type="omfile" dynafile="filename" template="outfmt")
16 }'
17
18 echoscip-shell system . . 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.'
19 startup
20 tcpflood -m1 -M "\"<129>Mar 10 01:00:00 172.20.245.8 file1 33:45:DDD::4
21 <129>Mar 10 01:00:00 172.20.245.8 file2 ::
22 <129>Mar 10 01:00:00 172.20.245.8 file6 ::
23 <129>Mar 10 01:00:00 172.20.245.8 file3 72:8374:adc7:47FF::43:0:1AFE
24 <129>Mar 10 01:00:00 172.20.245.8 file4 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF
25 <129>Mar 10 01:00:00 172.20.245.8 file5 72:8374:adc7:47FF::43:0:1AFE\""
26
27 shutdown_when_empty
28 wait_shutdown
29 echoscip-shell system . . echo. ' 33:45:DDD::4' | cmpscip-shell system . . cmp. - ${RSYSLOG_DYNNAME}.file1.log >/dev/nullscip-shell filesystem . . `/dev/null`.
30 if [scip-shell system . . `[`. ! $? -eq 1 ]; then
31 echoscip-shell system . . echo. "invalidly equal ip-address generated, ${RSYSLOG_DYNNAME}.file1.log is:"
32 catscip-shell system . . cat. ${RSYSLOG_DYNNAME}.file1.log
33 error_exit 1
34 fi;
35
36 echoscip-shell system . . echo. ' ::' | cmpscip-shell system . . cmp. - ${RSYSLOG_DYNNAME}.file2.log >/dev/nullscip-shell filesystem . . `/dev/null`.
37 if [scip-shell system . . `[`. ! $? -eq 1 ]; then
38 echoscip-shell system . . echo. "invalidly equal ip-address generated, ${RSYSLOG_DYNNAME}.file2.log is:"
39 catscip-shell system . . cat. ${RSYSLOG_DYNNAME}.file2.log
40 error_exit 1
41 fi;
42
43 echoscip-shell system . . echo. ' 72:8374:adc7:47FF::43:0:1AFE' | cmpscip-shell system . . cmp. - ${RSYSLOG_DYNNAME}.file3.log >/dev/nullscip-shell filesystem . . `/dev/null`.
44 if [scip-shell system . . `[`. ! $? -eq 1 ]; then
45 echoscip-shell system . . echo. "invalidly equal ip-address generated, ${RSYSLOG_DYNNAME}.file3.log is:"
46 catscip-shell system . . cat. ${RSYSLOG_DYNNAME}.file3.log
47 error_exit 1
48 fi;
49
50 echoscip-shell system . . echo. ' FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF' | cmpscip-shell system . . cmp. - ${RSYSLOG_DYNNAME}.file4.log >/dev/nullscip-shell filesystem . . `/dev/null`.
51 if [scip-shell system . . `[`. ! $? -eq 1 ]; then
52 echoscip-shell system . . echo. "invalidly equal ip-address generated, ${RSYSLOG_DYNNAME}.file4.log is:"
53 catscip-shell system . . cat. ${RSYSLOG_DYNNAME}.file4.log
54 error_exit 1
55 fi;
56
57 cmpscip-shell system . . cmp. ${RSYSLOG_DYNNAME}.file3.log ${RSYSLOG_DYNNAME}.file5.log >/dev/nullscip-shell filesystem . . `/dev/null`.
58 if [scip-shell system . . `[`. ! $? -eq 0 ]; then
59 echoscip-shell system . . echo. "invalidly unequal ip-addresses generated, ${RSYSLOG_DYNNAME}.file3.log and ${RSYSLOG_DYNNAME}.file5.log are:"
60 catscip-shell system . . cat. ${RSYSLOG_DYNNAME}.file3.log
61 catscip-shell system . . cat. ${RSYSLOG_DYNNAME}.file5.log
62 error_exit 1
63 fi;
64
65 cmpscip-shell system . . cmp. ${RSYSLOG_DYNNAME}.file2.log ${RSYSLOG_DYNNAME}.file6.log >/dev/nullscip-shell filesystem . . `/dev/null`.
66 if [scip-shell system . . `[`. ! $? -eq 0 ]; then
67 echoscip-shell system . . echo. "invalidly unequal ip-addresses generated, ${RSYSLOG_DYNNAME}.file1.log and ${RSYSLOG_DYNNAME}.file6.log are:"
68 catscip-shell system . . cat. ${RSYSLOG_DYNNAME}.file1.log
69 catscip-shell system . . cat. ${RSYSLOG_DYNNAME}.file6.log
70 error_exit 1
71 fi;
72
73 cmpscip-shell system . . cmp. ${RSYSLOG_DYNNAME}.file4.log ${RSYSLOG_DYNNAME}.file5.log >/dev/nullscip-shell filesystem . . `/dev/null`.
74 if [scip-shell system . . `[`. ! $? -eq 1 ]; then
75 echoscip-shell system . . echo. "invalidly equal ip-addresses generated, ${RSYSLOG_DYNNAME}.file4.log and ${RSYSLOG_DYNNAME}.file5.log are:"
76 catscip-shell system . . cat. ${RSYSLOG_DYNNAME}.file4.log
77 catscip-shell system . . cat. ${RSYSLOG_DYNNAME}.file5.log
78 error_exit 1
79 fi;
80
81 rmscip-shell system . . rm. -f ${RSYSLOG_DYNNAME}.*.log
82 exit_test