-# $OpenBSD: Proc.pm,v 1.5 2013/01/08 21:20:00 bluhm Exp $
+# $OpenBSD: Proc.pm,v 1.6 2014/05/09 11:49:26 andre Exp $
# Copyright (c) 2010-2013 Alexander Bluhm <bluhm@openbsd.org>
#
do {
my($kid, $status, $code) = $self->wait(WNOHANG);
- if ($kid > 0 && $status != 0) {
+ if ($kid > 0 && $status != 0 && not $self->{dummyrun}) {
# child terminated with failure
die ref($self), " child status: $status $code";
}
-# $OpenBSD: Relayd.pm,v 1.7 2014/05/02 14:10:03 andre Exp $
+# $OpenBSD: Relayd.pm,v 1.8 2014/05/09 11:49:26 andre Exp $
# Copyright (c) 2010-2012 Alexander Bluhm <bluhm@openbsd.org>
#
sub up {
my $self = Proc::up(shift, @_);
my $timeout = shift || 10;
+ my $dummyrun = $self->{dummyrun} || 0;
my $lsock = $self->loggrep(qr/relay_launch: /, $timeout)
or croak ref($self), " no relay_launch in $self->{logfile} ".
- "after $timeout seconds";
+ "after $timeout seconds" unless $dummyrun;
return $self;
}
relayd => {
protocol => [ "http",
'request path mark "*" from "/foobar" with 55',
- 'request path change "path" to "foobarchangedpath" marked 55',
+ 'request header append "bar" to "foo" marked 55',
],
loggrep => { ", 55,.*done" => 1 },
},
server => {
func => \&http_server,
+ loggrep => { "foo: bar" => 1 },
},
);
#!/usr/bin/perl
-# $OpenBSD: relayd.pl,v 1.8 2013/02/07 22:56:27 bluhm Exp $
+# $OpenBSD: relayd.pl,v 1.9 2014/05/09 11:49:26 andre Exp $
# Copyright (c) 2010-2013 Alexander Bluhm <bluhm@openbsd.org>
#
$s->run unless $args{server}{noserver};
$r->run;
$r->up;
-$c->run->up;
+$c->run->up unless $args{client}{noclient};
$s->up unless $args{server}{noserver};
-$c->down;
+$c->down unless $args{client}{noclient};
$s->down unless $args{server}{noserver};
$r->kill_child;
-$r->down;
+$r->down unless $args{relayd}{dummyrun};
check_logs($c, $r, $s, %args);