args-maxunix.pl revision 1.6
1# The client writes messages to MAXUNIX unix domain sockets.
2# The syslogd -a writes them into a file and through a pipe.
3# The syslogd -a passes them via UDP to the loghost.
4# The server receives the messages on its UDP socket.
5# Find the message in client, file, pipe, syslogd, server log.
6# Check that the file log contains a message from every socket.
7# Check that no error is printed.
8
9use strict;
10use warnings;
11use IO::Socket::UNIX;
12use constant MAXUNIX => 21;
13
14our %args = (
15    client => {
16	func => sub {
17	    my $self = shift;
18	    write_unix($self);
19	    foreach (1..(MAXUNIX-1)) {
20		write_unix($self, "unix-$_.sock");
21	    }
22	    ${$self->{syslogd}}->loggrep(get_testlog(), 5, MAXUNIX)
23		or die ref($self), " syslogd did not receive complete line";
24	    write_shutdown($self);
25	},
26    },
27    syslogd => {
28	options => [ map { ("-a" => "unix-$_.sock") } (1..(MAXUNIX-1)) ],
29	loggrep => {
30	    qr/out of descriptors/ => 0,
31	},
32    },
33    file => {
34	loggrep => {
35	    get_testlog()." /dev/log unix socket" => 1,
36	    (map { (get_testlog()." unix-$_.sock unix socket" => 1) }
37		(1..(MAXUNIX-1))),
38	    get_testlog()." unix-".MAXUNIX.".sock unix socket" => 0,
39	},
40    },
41);
42
431;
44