summaryrefslogtreecommitdiffstats
path: root/util/TLSProxy
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-06-14 14:35:26 +0100
committerMatt Caswell <matt@openssl.org>2016-06-16 16:32:14 +0100
commitb02b57431718b74ddaf24cc3db004f145311abac (patch)
tree25e749bb160539124071b5026df4f2b7971bd772 /util/TLSProxy
parentb84e12266f85156f58804ff94ea110890f13b52d (diff)
Skip the TLSProxy tests if environmental problems are an issue
On some platforms we can't startup the TLSProxy due to environmental problems (e.g. network set up on the build machine). These aren't OpenSSL problems so we shouldn't treat them as test failures. Just visibly indicate that we are skipping the test. We only skip the first time we attempt to start up the proxy. If that works then everything else should do...if not we should probably investigate and so report as a failure. This also removes test_networking...there is a danger that this turns into a test of user's environmental set up rather than OpenSSL. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'util/TLSProxy')
-rw-r--r--util/TLSProxy/Proxy.pm16
1 files changed, 11 insertions, 5 deletions
diff --git a/util/TLSProxy/Proxy.pm b/util/TLSProxy/Proxy.pm
index 3b03ea9eeb..e0ce43aa77 100644
--- a/util/TLSProxy/Proxy.pm
+++ b/util/TLSProxy/Proxy.pm
@@ -161,7 +161,7 @@ sub start
}
$self->serverpid($pid);
- $self->clientstart;
+ return $self->clientstart;
}
sub clientstart
@@ -188,7 +188,8 @@ sub clientstart
if ($proxy_sock) {
print "Proxy started on port ".$self->proxy_port."\n";
} else {
- die "Failed creating proxy socket (".$proxaddr.",".$self->proxy_port."): $!\n";
+ warn "Failed creating proxy socket (".$proxaddr.",".$self->proxy_port."): $!\n";
+ return 0;
}
if ($self->execute) {
@@ -213,8 +214,11 @@ sub clientstart
}
# Wait for incoming connection from client
- my $client_sock = $proxy_sock->accept()
- or die "Failed accepting incoming connection: $!\n";
+ my $client_sock;
+ if(!($client_sock = $proxy_sock->accept())) {
+ warn "Failed accepting incoming connection: $!\n";
+ return 0;
+ }
print "Connection opened\n";
@@ -245,7 +249,8 @@ sub clientstart
#Sleep for a short while
select(undef, undef, undef, 0.1);
} else {
- die "Failed to start up server (".$servaddr.",".$self->server_port."): $!\n";
+ warn "Failed to start up server (".$servaddr.",".$self->server_port."): $!\n";
+ return 0;
}
}
} while (!$server_sock);
@@ -295,6 +300,7 @@ sub clientstart
.$self->serverpid."\n";
waitpid( $self->serverpid, 0);
}
+ return 1;
}
sub process_packet