From 5a83fddddbf34b5da95507bbca99427616d37f79 Mon Sep 17 00:00:00 2001 From: Reyk Floeter Date: Mon, 15 Aug 2016 20:54:30 +0200 Subject: sync tests --- regress/tests/Proc.pm | 5 +++-- regress/tests/funcs.pl | 8 +++++--- regress/tests/httpd.pl | 7 ++++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/regress/tests/Proc.pm b/regress/tests/Proc.pm index 8f46012..a98cc17 100644 --- a/regress/tests/Proc.pm +++ b/regress/tests/Proc.pm @@ -1,4 +1,4 @@ -# $OpenBSD: Proc.pm,v 1.1 2015/07/16 16:35:57 reyk Exp $ +# $OpenBSD: Proc.pm,v 1.2 2016/05/03 19:13:04 bluhm Exp $ # Copyright (c) 2010-2014 Alexander Bluhm # @@ -147,7 +147,8 @@ sub loggrep { my $self = shift; my($regex, $timeout) = @_; - my $end = time() + $timeout if $timeout; + my $end; + $end = time() + $timeout if $timeout; do { my($kid, $status, $code) = $self->wait(WNOHANG); diff --git a/regress/tests/funcs.pl b/regress/tests/funcs.pl index 9a0db7e..beda09a 100644 --- a/regress/tests/funcs.pl +++ b/regress/tests/funcs.pl @@ -1,4 +1,4 @@ -# $OpenBSD: funcs.pl,v 1.5 2015/07/18 19:17:13 benno Exp $ +# $OpenBSD: funcs.pl,v 1.6 2016/05/03 19:13:04 bluhm Exp $ # Copyright (c) 2010-2015 Alexander Bluhm # @@ -425,7 +425,8 @@ sub check_len { $args{len} ||= 512 unless $args{lengths}; - my @clen = $c->loggrep(qr/^LEN: /) or die "no client len" + my @clen; + @clen = $c->loggrep(qr/^LEN: /) or die "no client len" unless $args{client}{nocheck}; # !@clen # or die "client: @clen", "len mismatch"; @@ -445,7 +446,8 @@ sub check_len { sub check_md5 { my ($c, $r, %args) = @_; - my @cmd5 = $c->loggrep(qr/^MD5: /) unless $args{client}{nocheck}; + my @cmd5; + @cmd5 = $c->loggrep(qr/^MD5: /) unless $args{client}{nocheck}; my @md5 = ref($args{md5}) eq 'ARRAY' ? @{$args{md5}} : $args{md5} || () or return; foreach my $md5 (@md5) { diff --git a/regress/tests/httpd.pl b/regress/tests/httpd.pl index 481a587..6ca2d83 100644 --- a/regress/tests/httpd.pl +++ b/regress/tests/httpd.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $OpenBSD: httpd.pl,v 1.1 2015/07/16 16:35:57 reyk Exp $ +# $OpenBSD: httpd.pl,v 1.2 2016/05/03 19:13:04 bluhm Exp $ # Copyright (c) 2010-2015 Alexander Bluhm # Copyright (c) 2015 Reyk Floeter @@ -41,7 +41,8 @@ if (@ARGV and -f $ARGV[-1]) { my $redo = $args{lengths} && @{$args{lengths}}; $redo = 0 if $args{client}{http_vers}; # run only one persistent connection my($sport, $rport) = find_ports(num => 2); -my $d = Httpd->new( +my($d, $c); +$d = Httpd->new( chroot => $ARGV[0], listendomain => AF_INET, listenaddr => "127.0.0.1", @@ -52,7 +53,7 @@ my $d = Httpd->new( %{$args{httpd}}, testfile => $testfile, ); -my $c = Client->new( +$c = Client->new( chroot => $ARGV[0], func => \&http_client, connectdomain => AF_INET, -- cgit v1.2.3-54-g00ecf