mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-12-09 08:44:01 +01:00
Just add comments, reorder lines
This commit is contained in:
@@ -1,15 +1,16 @@
|
|||||||
#!/usr/bin/env perl
|
#!/usr/bin/env perl
|
||||||
|
|
||||||
# Just a functional test, whether there are any problems on the client side
|
# Just a functional test, whether there are any problems on the client side
|
||||||
# Probably we could also inspect the JSON for any problems for
|
|
||||||
|
# We could also inspect the JSON for any problems for
|
||||||
# "id" : "scanProblem"
|
# "id" : "scanProblem"
|
||||||
# "finding" : "Scan interrupted"
|
# "finding" : "Scan interrupted"
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use Test::More;
|
use Test::More;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
# if needed: comment this and the lines below in:
|
||||||
# use JSON;
|
# use JSON;
|
||||||
# if we need JSON we need to comment this and the lines below in
|
|
||||||
|
|
||||||
my $tests = 0;
|
my $tests = 0;
|
||||||
my $prg="./testssl.sh";
|
my $prg="./testssl.sh";
|
||||||
@@ -17,7 +18,7 @@ my $check2run ="--client-simulation -q --ip=one --color 0";
|
|||||||
my $uri="";
|
my $uri="";
|
||||||
my $socket_out="";
|
my $socket_out="";
|
||||||
my $openssl_out="";
|
my $openssl_out="";
|
||||||
# Blacklists we use to trigger an error:
|
# Pattern we use to trigger an error:
|
||||||
my $socket_regex_bl='(e|E)rror|\.\/testssl\.sh: line |(f|F)atal|(c|C)ommand not found';
|
my $socket_regex_bl='(e|E)rror|\.\/testssl\.sh: line |(f|F)atal|(c|C)ommand not found';
|
||||||
my $openssl_regex_bl='(e|E)rror|(f|F)atal|\.\/testssl\.sh: line |Oops|s_client connect problem|(c|C)ommand not found';
|
my $openssl_regex_bl='(e|E)rror|(f|F)atal|\.\/testssl\.sh: line |Oops|s_client connect problem|(c|C)ommand not found';
|
||||||
|
|
||||||
@@ -30,8 +31,8 @@ STDOUT->autoflush(1);
|
|||||||
|
|
||||||
die "Unable to open $prg" unless -f $prg;
|
die "Unable to open $prg" unless -f $prg;
|
||||||
|
|
||||||
|
#1
|
||||||
$uri="google.com";
|
$uri="google.com";
|
||||||
|
|
||||||
# unlink "tmp.json";
|
# unlink "tmp.json";
|
||||||
printf "\n%s\n", "Client simulations unit test via sockets --> $uri ...";
|
printf "\n%s\n", "Client simulations unit test via sockets --> $uri ...";
|
||||||
$socket_out = `$prg $check2run $uri 2>&1`;
|
$socket_out = `$prg $check2run $uri 2>&1`;
|
||||||
@@ -39,6 +40,7 @@ $socket_out = `$prg $check2run $uri 2>&1`;
|
|||||||
unlike($socket_out, qr/$socket_regex_bl/, "");
|
unlike($socket_out, qr/$socket_regex_bl/, "");
|
||||||
$tests++;
|
$tests++;
|
||||||
|
|
||||||
|
#2 Makes little sense anymore but lets just keep this unit test
|
||||||
# unlink "tmp.json";
|
# unlink "tmp.json";
|
||||||
printf "\n%s\n", "Client simulations unit test via OpenSSL --> $uri ...";
|
printf "\n%s\n", "Client simulations unit test via OpenSSL --> $uri ...";
|
||||||
$openssl_out = `$prg $check2run --ssl-native $uri 2>&1`;
|
$openssl_out = `$prg $check2run --ssl-native $uri 2>&1`;
|
||||||
@@ -47,8 +49,8 @@ unlike($openssl_out, qr/$openssl_regex_bl/, "");
|
|||||||
$tests++;
|
$tests++;
|
||||||
|
|
||||||
|
|
||||||
|
#3
|
||||||
$uri="smtp-relay.gmail.com:587";
|
$uri="smtp-relay.gmail.com:587";
|
||||||
|
|
||||||
# unlink "tmp.json";
|
# unlink "tmp.json";
|
||||||
printf "\n%s\n", "STARTTLS: Client simulations unit test via sockets --> $uri ...";
|
printf "\n%s\n", "STARTTLS: Client simulations unit test via sockets --> $uri ...";
|
||||||
$socket_out = `$prg $check2run -t smtp $uri 2>&1`;
|
$socket_out = `$prg $check2run -t smtp $uri 2>&1`;
|
||||||
@@ -56,18 +58,10 @@ $socket_out = `$prg $check2run -t smtp $uri 2>&1`;
|
|||||||
unlike($socket_out, qr/$socket_regex_bl/, "");
|
unlike($socket_out, qr/$socket_regex_bl/, "");
|
||||||
$tests++;
|
$tests++;
|
||||||
|
|
||||||
# commented out, bc of travis' limits
|
|
||||||
#
|
|
||||||
# unlink "tmp.json";
|
# unlink "tmp.json";
|
||||||
#printf "\n%s\n", "STARTTLS: Client simulations unit test via OpenSSL --> $uri ...";
|
|
||||||
#$openssl_out = `$prg --ssl-native $check2run -t smtp $uri 2>&1`;
|
|
||||||
## $openssl_json = json('tmp.json');
|
|
||||||
#unlike($openssl_out, qr/$openssl_regex_bl/, "");
|
|
||||||
#$tests++;
|
|
||||||
|
|
||||||
done_testing($tests);
|
done_testing($tests);
|
||||||
unlink "tmp.json";
|
printf "\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sub json($) {
|
sub json($) {
|
||||||
@@ -78,5 +72,5 @@ sub json($) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# vim:ts=5:sw=5:expandtab
|
# vim:ts=5:sw=5:expandtab
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user