summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2011-03-13 03:15:42 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2011-03-13 03:15:42 +0000
commitc63f130ce30d4167526d41507dc76e87ff856407 (patch)
tree6349fa845a392b07b243ce779c655a4bb7d879e3 /regress
parent167e4b660e715042b4fa6816f424c6e6e6cbdc22 (diff)
Make regression tests more reliable.
Diffstat (limited to 'regress')
-rw-r--r--regress/sys/kern/splice/args-max-sleep-server.pl1
-rw-r--r--regress/sys/kern/splice/args-null-max-sleep-client-nonblock.pl2
-rw-r--r--regress/sys/kern/splice/args-null-max-sleep-client.pl2
-rw-r--r--regress/sys/kern/splice/args-null-sleep-client.pl2
-rw-r--r--regress/sys/kern/splice/args-oob-max-sleep-server.pl2
-rw-r--r--regress/sys/kern/splice/args-oobinline-max-sleep-server.pl2
-rw-r--r--regress/sys/kern/splice/args-relay-close-in.pl2
-rw-r--r--regress/sys/kern/splice/args-server-abort.pl2
-rw-r--r--regress/sys/kern/splice/args-server-exit.pl4
-rwxr-xr-xregress/sys/kern/splice/echo.pl16
-rwxr-xr-xregress/sys/kern/splice/relay.pl11
-rwxr-xr-xregress/sys/kern/splice/remote.pl8
12 files changed, 34 insertions, 20 deletions
diff --git a/regress/sys/kern/splice/args-max-sleep-server.pl b/regress/sys/kern/splice/args-max-sleep-server.pl
index 13f01f4e8a5..e6493ad3690 100644
--- a/regress/sys/kern/splice/args-max-sleep-server.pl
+++ b/regress/sys/kern/splice/args-max-sleep-server.pl
@@ -17,6 +17,7 @@ our %args = (
},
len => 32117,
md5 => "ee338e9693fb2a2ec101bb28935ed123",
+ noecho => 1,
);
1;
diff --git a/regress/sys/kern/splice/args-null-max-sleep-client-nonblock.pl b/regress/sys/kern/splice/args-null-max-sleep-client-nonblock.pl
index 801a9584d7e..42c3c5557cf 100644
--- a/regress/sys/kern/splice/args-null-max-sleep-client-nonblock.pl
+++ b/regress/sys/kern/splice/args-null-max-sleep-client-nonblock.pl
@@ -5,7 +5,7 @@ use warnings;
our %args = (
client => {
- func => sub { sleep 3 },
+ func => sub { sleep 3; write_char(@_); },
len => 0,
},
relay => {
diff --git a/regress/sys/kern/splice/args-null-max-sleep-client.pl b/regress/sys/kern/splice/args-null-max-sleep-client.pl
index cbf89b46a49..d39b7ee6897 100644
--- a/regress/sys/kern/splice/args-null-max-sleep-client.pl
+++ b/regress/sys/kern/splice/args-null-max-sleep-client.pl
@@ -5,7 +5,7 @@ use warnings;
our %args = (
client => {
- func => sub { sleep 3 },
+ func => sub { sleep 3; write_char(@_); },
len => 0,
},
relay => {
diff --git a/regress/sys/kern/splice/args-null-sleep-client.pl b/regress/sys/kern/splice/args-null-sleep-client.pl
index 5a02ceb43f4..2205b87853d 100644
--- a/regress/sys/kern/splice/args-null-sleep-client.pl
+++ b/regress/sys/kern/splice/args-null-sleep-client.pl
@@ -5,7 +5,7 @@ use warnings;
our %args = (
client => {
- func => sub { sleep 3 },
+ func => sub { sleep 3; write_char(@_); },
len => 0,
},
len => 0,
diff --git a/regress/sys/kern/splice/args-oob-max-sleep-server.pl b/regress/sys/kern/splice/args-oob-max-sleep-server.pl
index 39193a63585..72dff6a0dfb 100644
--- a/regress/sys/kern/splice/args-oob-max-sleep-server.pl
+++ b/regress/sys/kern/splice/args-oob-max-sleep-server.pl
@@ -10,13 +10,13 @@ our %args = (
},
relay => {
max => 61,
- nocheck => 1,
},
server => {
func => sub { sleep 3; read_oob(@_); },
},
len => 61,
md5 => "e4282daf8d2ca21cc8b70b1314713314",
+ noecho => 1,
);
1;
diff --git a/regress/sys/kern/splice/args-oobinline-max-sleep-server.pl b/regress/sys/kern/splice/args-oobinline-max-sleep-server.pl
index 7f35a2cb405..d4145fe8a0a 100644
--- a/regress/sys/kern/splice/args-oobinline-max-sleep-server.pl
+++ b/regress/sys/kern/splice/args-oobinline-max-sleep-server.pl
@@ -11,13 +11,13 @@ our %args = (
relay => {
oobinline => 1,
max => 61,
- nocheck => 1,
},
server => {
func => sub { sleep 3; read_oob(@_); },
},
len => 61,
md5 => "c9f459db9b4f369980c79bff17e1c2a0",
+ noecho => 1,
);
1;
diff --git a/regress/sys/kern/splice/args-relay-close-in.pl b/regress/sys/kern/splice/args-relay-close-in.pl
index 06180bc910c..95cb3c03b82 100644
--- a/regress/sys/kern/splice/args-relay-close-in.pl
+++ b/regress/sys/kern/splice/args-relay-close-in.pl
@@ -10,6 +10,7 @@ our %args = (
sndbuf => 2**10, # small buffer triggers error during write
# the error message seems to be timing dependent
down => "Client print failed: (Broken pipe|Connection reset by peer)",
+ nocheck => 1,
error => 54,
},
relay => {
@@ -23,6 +24,7 @@ our %args = (
},
server => {
rcvbuf => 2**10,
+ nocheck => 1,
},
);
diff --git a/regress/sys/kern/splice/args-server-abort.pl b/regress/sys/kern/splice/args-server-abort.pl
index b0b64874e6d..f88e29cbdd7 100644
--- a/regress/sys/kern/splice/args-server-abort.pl
+++ b/regress/sys/kern/splice/args-server-abort.pl
@@ -10,6 +10,7 @@ our %args = (
sndbuf => 2**10, # small buffer triggers error during write
# the error message seems to be timing dependent
down => "Client print failed: (Broken pipe|Connection reset by peer)",
+ nocheck => 1,
error => 54,
},
relay => {
@@ -24,6 +25,7 @@ our %args = (
server => {
func => sub { $SIG{ALRM} = sub { print STDERR "\nShutdown\n"; exit 0 };
alarm(3); read_char(@_); },
+ nocheck => 1,
},
noecho => 1,
);
diff --git a/regress/sys/kern/splice/args-server-exit.pl b/regress/sys/kern/splice/args-server-exit.pl
index 99cc94b0bb6..2698ac7d157 100644
--- a/regress/sys/kern/splice/args-server-exit.pl
+++ b/regress/sys/kern/splice/args-server-exit.pl
@@ -10,6 +10,7 @@ our %args = (
sndbuf => 2**10, # small buffer triggers error during write
# the error message seems to be timing dependent
down => "Client print failed: (Broken pipe|Connection reset by peer)",
+ nocheck => 1,
error => 54,
},
relay => {
@@ -24,9 +25,8 @@ our %args = (
server => {
func => sub { sleep 3; },
rcvbuf => 2**10,
+ nocheck => 1,
},
- len => 131072,
- md5 => "31e5ad3d0d2aeb1ad8aaa847dfa665c2",
noecho => 1,
);
diff --git a/regress/sys/kern/splice/echo.pl b/regress/sys/kern/splice/echo.pl
index 4cf12252fa2..30d011558b2 100755
--- a/regress/sys/kern/splice/echo.pl
+++ b/regress/sys/kern/splice/echo.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# $OpenBSD: echo.pl,v 1.1 2011/01/07 22:06:08 bluhm Exp $
+# $OpenBSD: echo.pl,v 1.2 2011/03/13 03:15:41 bluhm Exp $
# Copyright (c) 2010 Alexander Bluhm <bluhm@openbsd.org>
#
@@ -49,7 +49,7 @@ my $r = Server->new(
%{$args{relay}},
);
my $s = Child->new(
- logfile => "server.log",
+ logfile => "server.log",
oobinline => 1,
%{$args{server}},
func => sub {
@@ -65,7 +65,8 @@ my $c = Client->new(
%{$args{client}},
func => sub {
$s->run->up;
- ($args{client}{func} || \&write_char)->(@_);
+ eval { ($args{client}{func} || \&write_char)->(@_) };
+ warn $@ if $@;
eval { shutout(@_) };
$s->down;
},
@@ -81,9 +82,12 @@ $s->{pid} = -1; # XXX hack
exit if $args{nocheck};
-my $clen = $c->loggrep(qr/^LEN: /) unless $args{client}{nocheck};
-my $rlen = $r->loggrep(qr/^LEN: /) unless $args{relay}{nocheck};
-my $slen = $s->loggrep(qr/^LEN: /) unless $args{server}{nocheck};
+my $clen = $c->loggrep(qr/^LEN: /) // die "no client len"
+ unless $args{client}{nocheck};
+my $rlen = $r->loggrep(qr/^LEN: /) // die "no relay len"
+ unless $args{relay}{nocheck};
+my $slen = $s->loggrep(qr/^LEN: /) // die "no server len"
+ unless $args{server}{nocheck};
!$clen || !$rlen || $clen eq $rlen
or die "client: $clen", "relay: $rlen", "len mismatch";
!$rlen || !$slen || $rlen eq $slen
diff --git a/regress/sys/kern/splice/relay.pl b/regress/sys/kern/splice/relay.pl
index d7740cd1e41..72c12ede581 100755
--- a/regress/sys/kern/splice/relay.pl
+++ b/regress/sys/kern/splice/relay.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# $OpenBSD: relay.pl,v 1.1 2011/01/07 22:06:08 bluhm Exp $
+# $OpenBSD: relay.pl,v 1.2 2011/03/13 03:15:41 bluhm Exp $
# Copyright (c) 2010 Alexander Bluhm <bluhm@openbsd.org>
#
@@ -76,9 +76,12 @@ $s->down;
exit if $args{nocheck};
-my $clen = $c->loggrep(qr/^LEN: /) unless $args{client}{nocheck};
-my $rlen = $r->loggrep(qr/^LEN: /) unless $args{relay}{nocheck};
-my $slen = $s->loggrep(qr/^LEN: /) unless $args{server}{nocheck};
+my $clen = $c->loggrep(qr/^LEN: /) // die "no client len"
+ unless $args{client}{nocheck};
+my $rlen = $r->loggrep(qr/^LEN: /) // die "no relay len"
+ unless $args{relay}{nocheck};
+my $slen = $s->loggrep(qr/^LEN: /) // die "no server len"
+ unless $args{server}{nocheck};
!$clen || !$rlen || $clen eq $rlen
or die "client: $clen", "relay: $rlen", "len mismatch";
!$rlen || !$slen || $rlen eq $slen
diff --git a/regress/sys/kern/splice/remote.pl b/regress/sys/kern/splice/remote.pl
index 4d08e54657f..775621779c4 100755
--- a/regress/sys/kern/splice/remote.pl
+++ b/regress/sys/kern/splice/remote.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# $OpenBSD: remote.pl,v 1.1 2011/01/07 22:06:08 bluhm Exp $
+# $OpenBSD: remote.pl,v 1.2 2011/03/13 03:15:41 bluhm Exp $
# Copyright (c) 2010 Alexander Bluhm <bluhm@openbsd.org>
#
@@ -128,8 +128,10 @@ $s->down;
exit if $args{nocheck};
-my $clen = $c->loggrep(qr/^LEN: /) unless $args{client}{nocheck};
-my $slen = $s->loggrep(qr/^LEN: /) unless $args{server}{nocheck};
+my $clen = $c->loggrep(qr/^LEN: /) // die "no client len"
+ unless $args{client}{nocheck};
+my $slen = $s->loggrep(qr/^LEN: /) // die "no server len"
+ unless $args{server}{nocheck};
!$clen || !$slen || $clen eq $slen
or die "client: $clen", "server: $slen", "len mismatch";
!defined($args{len}) || !$clen || $clen eq "LEN: $args{len}\n"