From: des Date: Wed, 8 Aug 2007 12:08:25 +0000 (+0000) Subject: Start varnishd with '-n regress'. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=487ab364a749ba01ea1c0bec7c2d83018277e0b2;p=varnish Start varnishd with '-n regress'. Handle server failures gracefully. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1814 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-tools/regress/lib/Varnish/Test/Engine.pm b/varnish-tools/regress/lib/Varnish/Test/Engine.pm index 7ec53cb9..b654d95b 100644 --- a/varnish-tools/regress/lib/Varnish/Test/Engine.pm +++ b/varnish-tools/regress/lib/Varnish/Test/Engine.pm @@ -59,7 +59,8 @@ sub new($$;%) { %config = ('server_address' => 'localhost:8081', 'varnish_address' => 'localhost:8080', - 'storage_spec' => 'file,/tmp/regress.bin,512k', + 'varnish_name' => 'regress', + 'storage_spec' => 'file,regress.bin,512k', %config); my $self = bless({ 'mux' => IO::Multiplex->new, @@ -107,9 +108,10 @@ sub run_loop($@) { $self->{'wait_for'} = \@wait_for; $self->{'in_loop'} = 1; - $self->{'mux'}->loop; + eval { $self->{'mux'}->loop; }; delete $self->{'in_loop'}; delete $self->{'wait_for'}; + die $@ if ($@); # Loop has now been paused due to the occurrence of an event we # were waiting for. This event is always found in the front of the diff --git a/varnish-tools/regress/lib/Varnish/Test/Varnish.pm b/varnish-tools/regress/lib/Varnish/Test/Varnish.pm index e8a4200b..c32fcfe3 100644 --- a/varnish-tools/regress/lib/Varnish/Test/Varnish.pm +++ b/varnish-tools/regress/lib/Varnish/Test/Varnish.pm @@ -96,6 +96,7 @@ sub new($$;$) { my @opts = ('-d', '-d', '-s', $engine->{'config'}->{'storage_spec'}, + '-n', $engine->{'config'}->{'varnish_name'}, '-a', $engine->{'config'}->{'varnish_address'}, '-b', $engine->{'config'}->{'server_address'});