1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# Test TCP with rsyslogd as sender.
# The client writes a message to rsyslogd UDP socket.
# The rsyslogd forwards the message to syslogd TCP listen socket.
# The syslogd writes it into a file and through a pipe.
# The syslogd passes it via UDP to the rsyslogd.
# The rsyslogd receives the message on its UDP socket.
# Find the message in rsyslogd, file, pipe, syslogd, server log.
# Check that the message is in rsyslogd, syslogd, server log.
use strict;
use warnings;
use Socket;
our %args = (
client => {
connect => { domain => AF_INET, proto => "udp", addr => "127.0.0.1" },
},
rsyslogd => {
listen => { domain => AF_INET, proto => "udp", addr => "127.0.0.1" },
connect => { domain => AF_INET, proto => "tcp", addr => "127.0.0.1",
port => 514 },
loggrep => {
qr/omfile.* /.get_testgrep() => 1,
},
},
syslogd => {
options => ["-T", "127.0.0.1:514"],
loggrep => {
get_testgrep() => 1,
qr/syslogd\[\d+\]: tcp logger .* accepted/ => 1,
},
},
);
1;
|