RLIMIT_NOFILE => 30,
},
loggrep => {
- qr/syslogd: receive_fd: recvmsg: Message too long/ => 5,
+ qr/syslogd: receive_fd: recvmsg: Message too long/ => 5*2,
# One file is opened by test default config, 20 by multifile.
qr/X FILE:/ => 1+15,
qr/X UNUSED:/ => 5,
RLIMIT_NOFILE => 30,
},
loggrep => {
- qr/syslogd: receive_fd: recvmsg: Message too long/ => 6,
+ qr/syslogd: receive_fd: recvmsg: Message too long/ => 6*2,
# One file is opened by test default config, 20 by multifile.
qr/X FILE:/ => 1+14,
qr/X UNUSED:/ => 6,
syslogd => {
loghost => '@'.('X'x256).':514',
loggrep => {
- qr/syslogd: host too long "\@X+/ => 1,
+ qr/syslogd\[\d+\]: host too long "\@X+/ => 1,
get_testgrep() => 1,
},
},
syslogd => {
loghost => '@'.('X'x300),
loggrep => {
- qr/syslogd: loghost too long "\@X+/ => 1,
+ qr/syslogd\[\d+\]: loghost too long "\@X+/ => 1,
get_testgrep() => 1,
},
},
syslogd => {
loghost => '@127.0.0.1:'.('X'x32),
loggrep => {
- qr/syslogd: port too long "\@127.0.0.1:X+/ => 1,
+ qr/syslogd\[\d+\]: port too long "\@127.0.0.1:X+/ => 1,
get_testgrep() => 1,
},
},
--- /dev/null
+# The syslogd has a non existing log file in its config.
+# The client waits for syslogd startup and sends sighup.
+# The client writes a message to Sys::Syslog native method.
+# The syslogd writes it into a file and through a pipe and to tty.
+# The syslogd passes it via UDP to the loghost.
+# The server receives the message on its UDP socket.
+# Find the message in client, file, pipe, console, user, syslogd, server log.
+# Check that only the error message is twice in the console log.
+
+use strict;
+use warnings;
+
+our %args = (
+ client => {
+ func => sub {
+ my $self = shift;
+ ${$self->{syslogd}}->loggrep("syslogd: started", 5)
+ or die ref($self), " no 'syslogd: started' in log";
+ ${$self->{syslogd}}->kill_syslogd('HUP');
+ ${$self->{syslogd}}->loggrep("syslogd: restarted", 5)
+ or die ref($self), " no 'syslogd: restarted' in log";
+ write_log($self);
+ },
+ },
+ syslogd => {
+ conf => "*.*\t\$objdir/file-noexist.log\n",
+ loggrep => {
+ qr{syslogd\[\d+\]: priv_open_log ".*/file-noexist.log": }.
+ qr{No such file or directory} => 2,
+ qr/syslogd: started/ => 1,
+ qr/syslogd: restarted/ => 1,
+ },
+ noconsole => 1, # do not write /dev/console in config file
+ },
+ console => {
+ loggrep => {
+ qr{".*/file-noexist.log": No such file or directory} => 2,
+ qr/syslogd\[\d+\]: start/ => 0,
+ qr/syslogd\[\d+\]: restart/ => 0,
+ get_testgrep() => 0,
+ },
+ },
+ file => {
+ loggrep => {
+ qr{".*/file-noexist.log": No such file or directory} => 0,
+ qr/syslogd\[\d+\]: start/ => 1,
+ qr/syslogd\[\d+\]: restart/ => 1,
+ get_testgrep() => 1,
+ },
+ },
+);
+
+1;
--- /dev/null
+# The syslogd has a non existing log file in its config.
+# The client writes a message to Sys::Syslog native method.
+# The syslogd writes it into a file and through a pipe and to tty.
+# The syslogd passes it via UDP to the loghost.
+# The server receives the message on its UDP socket.
+# Find the message in client, file, pipe, console, user, syslogd, server log.
+# Check that the error message during config read is in the console log.
+
+use strict;
+use warnings;
+
+our %args = (
+ syslogd => {
+ conf => "*.*\t\$objdir/file-noexist.log\n",
+ loggrep => {
+ qr{syslogd\[\d+\]: priv_open_log ".*/file-noexist.log": }.
+ qr{No such file or directory} => 1,
+ },
+ },
+ console => {
+ loggrep => {
+ qr{".*/file-noexist.log": No such file or directory} => 1,
+ get_testgrep() => 1,
+ },
+ },
+ file => {
+ loggrep => {
+ qr{".*/file-noexist.log": No such file or directory} => 0,
+ get_testgrep() => 1,
+ },
+ },
+);
+
+1;
syslogd => {
loghost => '@invalid://127.0.0.1',
loggrep => {
- qr/syslogd: bad protocol "\@invalid:\/\/127.0.0.1"/ => 1,
+ qr/syslogd\[\d+\]: bad protocol "\@invalid:\/\/127.0.0.1"/ => 1,
get_testgrep() => 1,
},
},
syslogd => {
loghost => '@udp4://[::1]',
loggrep => {
- qr/syslogd: bad hostname "\@udp4:\/\/\[::1\]"/ => 1,
+ qr/syslogd\[\d+\]: bad hostname "\@udp4:\/\/\[::1\]"/ => 1,
get_testgrep() => 1,
},
},
syslogd => {
loghost => '@udp4://127.0.0.1',
loggrep => {
- qr/syslogd: no udp4 "\@udp4:\/\/127.0.0.1/ => 1,
+ qr/syslogd\[\d+\]: no udp4 "\@udp4:\/\/127.0.0.1/ => 1,
get_testgrep() => 1,
},
options => ["-6"],
syslogd => {
loghost => '@udp6://127.0.0.1',
loggrep => {
- qr/syslogd: bad hostname "\@udp6:\/\/127.0.0.1"/ => 1,
+ qr/syslogd\[\d+\]: bad hostname "\@udp6:\/\/127.0.0.1"/ => 1,
get_testgrep() => 1,
},
},
syslogd => {
loghost => '@udp6://[::1]',
loggrep => {
- qr/syslogd: no udp6 "\@udp6:\/\/\[::1\]/ => 1,
+ qr/syslogd\[\d+\]: no udp6 "\@udp6:\/\/\[::1\]/ => 1,
get_testgrep() => 1,
},
options => ["-4"],
syslogd => {
loghost => '@tls://localhost:$connectport',
loggrep => {
- qr/syslogd: load client TLS CA: failed to open CA file/ => 1,
+ qr/syslogd\[\d+\]: load client TLS CA: failed to open CA file/ => 1,
qr/Logging to FORWTLS \@tls:\/\/localhost:\d+/ => '>=4',
qr/syslogd\[\d+\]: tls_connect_socket .*: /.
qr/ssl verify memory setup failure/ => 1,