]> err.no Git - varnish/commitdiff
Start varnishd with '-n regress'.
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 8 Aug 2007 12:08:25 +0000 (12:08 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 8 Aug 2007 12:08:25 +0000 (12:08 +0000)
Handle server failures gracefully.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1814 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-tools/regress/lib/Varnish/Test/Engine.pm
varnish-tools/regress/lib/Varnish/Test/Varnish.pm

index 7ec53cb943757f35650042cf1663749cd3270b18..b654d95bf2400890274c93a0b6347a234b4330dd 100644 (file)
@@ -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
index e8a4200b2349212dda2f24a69b87fdefced965f3..c32fcfe367917c7bcce618f33f3948d9e80523bb 100644 (file)
@@ -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'});