1# The syslogd is started with reduced file descriptor limits.
2# The syslogd config contains more log files than possible.
3# The client connects to the 127.0.0.1 TCP socket, but is not accepted.
4# Check the error messages and that syslogd tries to listen again.
5
6use strict;
7use warnings;
8use Socket;
9
10our %args = (
11    client => {
12	connect => { domain => AF_INET, proto => "tcp", addr => "127.0.0.1",
13	    port => 514 },
14	logsock => { type => "tcp", host => "127.0.0.1", port => 514 },
15	func => sub {
16	    my $self = shift;
17	    ${$self->{syslogd}}->loggrep("Listen again", 5);
18	    write_log($self);
19	},
20    },
21    syslogd => {
22	options => ["-T", "127.0.0.1:514"],
23	conf => join("", map { "*.*\t\$objdir/file-$_.log\n" } 0..19),
24	rlimit => {
25	    RLIMIT_NOFILE => 30,
26	},
27	loggrep => {
28	    qr/syslogd: receive_fd: recvmsg: Message too long/ => 7+1,
29	    # One file is opened by test default config, 20 by multifile.
30	    qr/X FILE:/ => 1+13,
31	    qr/X UNUSED:/ => 7,
32	    qr/Accepting tcp connection/ => 0,
33	    qr/Listen again/ => '>=1',
34	},
35    },
36    server => {
37	loggrep => { get_testlog() => 0 },
38    },
39    multifile => [
40	(map { { loggrep => qr/syslogd\[\d+\]: accept deferred/ } } 0..12),
41	(map { { loggrep => { qr/./s => 0 } } } 13..19),
42    ],
43    file => {
44	loggrep => qr/syslogd\[\d+\]: accept deferred: Too many open files/,
45    },
46    pipe => { nocheck => 1 },
47    tty => { nocheck => 1 },
48);
49
501;
51