mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-09-05 19:42:54 +02:00
Output adjustments closer to a more common format
This commit is contained in:
@ -21,10 +21,10 @@ die "Unable to open $prg" unless -f $prg;
|
||||
|
||||
my $uri="cloudflare.com";
|
||||
|
||||
printf "\n%s", "Unit testing JSON output ...";
|
||||
printf "\n%s\n", "Unit testing JSON output ...";
|
||||
|
||||
#1
|
||||
printf "%s\n", ".. plain JSON output --> $uri ";
|
||||
printf "%s\n", ".. plain JSON --> $uri ";
|
||||
$out = `./testssl.sh $check2run --jsonfile tmp.json $uri`;
|
||||
$json = json('tmp.json');
|
||||
unlink 'tmp.json';
|
||||
@ -33,7 +33,7 @@ is(@errors,0,"no errors");
|
||||
$tests++;
|
||||
|
||||
#2
|
||||
printf "%s\n", ".. pretty JSON output --> $uri ";
|
||||
printf "%s\n", ".. pretty JSON --> $uri ";
|
||||
$out = `./testssl.sh $check2run --jsonfile-pretty tmp.json $uri`;
|
||||
$json = json('tmp.json');
|
||||
unlink 'tmp.json';
|
||||
@ -45,7 +45,7 @@ $tests++;
|
||||
#3
|
||||
# This testss.sh run deliberately does NOT work as travis-ci.org blocks port 25 egress.
|
||||
# but the output should be fine. The idea is to have a unit test for a failed connection.
|
||||
printf "%s\n", ".. plain JSON output for a failed run '--mx $uri' ...";
|
||||
printf "%s\n", ".. plain JSON for a failed run: '--mx $uri' ...";
|
||||
$out = `./testssl.sh --ssl-native --openssl-timeout=10 $check2run --jsonfile tmp.json --mx $uri`;
|
||||
$json = json('tmp.json');
|
||||
unlink 'tmp.json';
|
||||
@ -55,7 +55,7 @@ $tests++;
|
||||
|
||||
#4
|
||||
# Same as above but with pretty JSON
|
||||
printf "%s\n", ".. pretty JSON output for a failed run '--mx $uri' ...";
|
||||
printf "%s\n", ".. pretty JSON for a failed run '--mx $uri' ...";
|
||||
$out = `./testssl.sh --ssl-native --openssl-timeout=10 $check2run --jsonfile-pretty tmp.json --mx $uri`;
|
||||
$json = json('tmp.json');
|
||||
unlink 'tmp.json';
|
||||
@ -65,7 +65,7 @@ $tests++;
|
||||
|
||||
#5
|
||||
my $uri = "smtp-relay.gmail.com:587";
|
||||
printf "%s\n", " .. plain JSON output --> $uri ...";
|
||||
printf "%s\n", " .. plain JSON and STARTTLS --> $uri ...";
|
||||
$out = `./testssl.sh --jsonfile tmp.json $check2run -t smtp $uri`;
|
||||
$json = json('tmp.json');
|
||||
unlink 'tmp.json';
|
||||
@ -73,7 +73,7 @@ unlink 'tmp.json';
|
||||
is(@errors,0,"no errors");
|
||||
$tests++;
|
||||
|
||||
|
||||
printf "\n";
|
||||
done_testing($tests);
|
||||
|
||||
sub json($) {
|
||||
|
Reference in New Issue
Block a user