Lines Matching full:my
28 my $firstlog = "syslogd regress test first message";
29 my $secondlog = "syslogd regress test second message";
30 my $thirdlog = "syslogd regress test third message";
31 my $testlog = "syslogd regress test log message";
32 my $downlog = "syslogd regress client shutdown";
33 my $charlog = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
36 my %args = @_;
37 my $num = delete $args{num} // 1;
38 my $domain = delete $args{domain} // AF_INET;
39 my $addr = delete $args{addr} // "127.0.0.1";
40 my $proto = delete $args{proto} // "udp";
43 my @sockets = (1..$num);
44 foreach my $s (@sockets) {
51 my @ports = map { $_->sockport() } @sockets;
61 my $self = shift;
70 my $self = shift;
71 my $func = shift;
82 my $self = shift;
85 my $msg = join("", @_);
87 my $flags = $self->{connect}{flags} || 0;
92 defined(my $n = syswrite(STDOUT, $msg))
107 my $msg = shift;
108 my $flags = shift;
114 my $self = shift;
125 defined(read(STDIN, my $buf, 1))
131 my $self = shift;
132 my ($lines, $length) = @_;
140 my $self = shift;
141 my ($lengths, $tail) = ref $_[0] ? @_ : [@_];
147 my ($len) = @_;
149 my $msg = "";
150 my $char = '0';
151 for (my $i = 0; $i < $len; $i++) {
162 my $self = shift;
163 my ($length, $tail) = @_;
165 foreach my $len (ref $length ? @$length : $length) {
166 my $t = $tail // "";
169 my $msg = generate_chars($len - length($t));
178 my $self = shift;
179 my $path = shift || "/dev/log";
180 my $id = shift // $path;
182 my $u = IO::Socket::UNIX->new(
186 my $msg = "id $id unix socket: $testlog";
192 my $self = shift;
193 my $fh = shift || \*STDOUT;
194 my $id = shift // $fh;
196 my $msg = "id $id tcp socket: $testlog";
202 my $self = shift;
203 my $func = shift;
213 if (my $redo = shift @{$self->{redo}}) {
214 if (my $connect = $redo->{connect}) {
220 } elsif (my $logsock = $redo->{logsock}) {
248 my $self = shift;
254 my $self = shift;
255 my $func = shift;
264 my $self = shift;
265 my $func = shift;
279 my $self = shift;
280 my $regex = shift;
286 defined(my $n = sysread(STDIN, $_, 8194))
340 my %s2m = @_;
341 my $conf = "";
342 my $i = 0;
343 foreach my $sel (sort keys %s2m) {
351 my %s2m = @_;
352 my %allmsg;
354 my @loggrep;
355 foreach my $sel (sort keys %s2m) {
356 my @m = @{$s2m{$sel}};
357 my %msg;
359 my %nomsg = %allmsg;
370 my ($c, $r, $s, $m, %args) = @_;
378 if (my $file = $s->{"outfile"}) {
379 my $pattern = $s->{filegrep} || get_testgrep();
404 my ($name, $proc, $pattern, $func) = @_;
407 foreach my $pat (@$pattern) {
409 foreach my $re (sort keys %$pat) {
410 my $num = $pat->{$re};
411 my @matches = $func->($proc, $re);
424 foreach my $proc (@_) {
426 my $pattern = $proc->{loggrep} || get_testgrep();
432 my ($proc, $pattern) = @_;
438 my ($r, %args) = @_;
443 foreach my $dev (qw(console user)) {
447 my $ctl = $r->{"ctl$dev"};
449 my $file = $r->{"out$dev"};
450 open(my $fh, '<', $file)
456 foreach my $name (qw(file pipe console user)) {
458 my $file = $r->{"out$name"} or die;
459 my $pattern = $args{$name}{loggrep} || get_testgrep();
465 foreach my $proc (@_) {
466 my $pattern = $proc && $proc->{fstat} or next;
467 my $file = $proc->{fstatfile} or die;
473 my ($file, $pattern) = @_;
475 open(my $fh, '<', $file)
482 foreach my $proc (@_) {
483 my $pattern = $proc && $proc->{ktrace} or next;
484 my $file = $proc->{ktracefile} or die;
490 my ($file, $pattern) = @_;
492 my @sudo = ! -r $file && $ENV{SUDO} ? $ENV{SUDO} : ();
493 my @cmd = (@sudo, "kdump", "-f", $file);
494 open(my $fh, '-|', @cmd)
496 my @matches = grep { /$pattern/ } <$fh>;
504 for (my $i = 0; $i < @_; $i++) {
505 my $file = "file-$i.log";
506 open(my $fh, '>', $file)
512 for (my $i = 0; $i < @_; $i++) {
513 my $file = "file-$i.log";
514 my $pattern = $_[$i]{loggrep} or die;