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