Skip to content

Commit

Permalink
test to drop connection before writing anything (fix yrutschle#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
yrutschle committed Aug 28, 2021
1 parent a704c7f commit 3013658
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions t
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ my $PROBES_NOFRAG = 1;
my $PROBES_AGAIN = 1;
my $SSL_MIX_SSH = 1;
my $SSH_MIX_SSL = 1;
my $DROP_CNX = 1;

# Robustness tests. These are mostly to achieve full test
# coverage, but do not necessarily result in an actual test
Expand Down Expand Up @@ -285,6 +286,19 @@ for my $binary (@binaries) {
}
}

# Test: Drop connection without writing anything
if ($DROP_CNX) {
print "***Test: Connect but don't write anything\n";
my $cnx_h = new IO::Socket::INET(PeerHost => "localhost:$sslh_port");
warn "$!\n" unless $cnx_h;
if ($cnx_h) {
close $cnx_h;
my_is(1, "$binary: Connect and write nothing");
# The goal of the test is to check sslh doesn't
# crash
}
}


if ($PROBES_NOFRAG) {
test_probes(no_frag => 1, binary => $binary);
Expand Down

0 comments on commit 3013658

Please sign in to comment.