mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-09-04 02:58:28 +02:00
Output adjustments closer to a more common format
This commit is contained in:
@ -18,8 +18,10 @@ my $check2run="--color 0 --htmlfile tmp.html";
|
||||
|
||||
die "Unable to open $prg" unless -f $prg;
|
||||
|
||||
printf "\n%s\n", "Doing HTML output checks";
|
||||
|
||||
#1
|
||||
printf "\n%s\n", "Running $prg against $uri to create HTML and terminal outputs (may take 2~3 minutes) ...";
|
||||
printf "%s\n", " .. running $prg against $uri to create HTML and terminal outputs (may take 2~3 minutes)";
|
||||
# specify a TERM_WIDTH so that the two calls to testssl.sh don't create HTML files with different values of TERM_WIDTH
|
||||
$out = `TERM_WIDTH=120 $prg $check2run $uri`;
|
||||
$html = `cat tmp.html`;
|
||||
@ -41,12 +43,12 @@ $edited_html =~ s/>/>/g;
|
||||
$edited_html =~ s/"/"/g;
|
||||
$edited_html =~ s/'/'/g;
|
||||
|
||||
printf "\n%s\n", "Comparing HTML and terminal outputs";
|
||||
printf "\n%s\n", " .. comparing HTML and terminal outputs";
|
||||
cmp_ok($edited_html, "eq", $out, "HTML file matches terminal output");
|
||||
$tests++;
|
||||
|
||||
#2
|
||||
printf "\n%s\n", "Running $prg against $uri with --debug 4 to create HTML output (may take 2~3 minutes)";
|
||||
printf "\n%s\n", " .. running $prg against $uri with --debug 4 to create HTML output (may take another 2~3 minutes)";
|
||||
# Redirect stderr to /dev/null in order to avoid some unexplained "date: invalid date" error messages
|
||||
$out = `TERM_WIDTH=120 $prg $check2run --debug 4 $uri 2> /dev/null`;
|
||||
$debughtml = `cat tmp.html`;
|
||||
@ -66,9 +68,9 @@ $debughtml =~ s/HTTP clock skew \+?-?[0-9]* /HTTP clock skew
|
||||
$debughtml =~ s/ Pre-test: .*\n//g;
|
||||
$debughtml =~ s/.*OK: below 825 days.*\n//g;
|
||||
|
||||
printf "\n%s\n", "Checking that using the --debug option doesn't affect the HTML file";
|
||||
printf "\n%s\n", " .. checking that using the --debug option doesn't affect the HTML file";
|
||||
cmp_ok($debughtml, "eq", $html, "HTML file created with --debug 4 matches HTML file created without --debug");
|
||||
$tests++;
|
||||
printf "\n%s\n";
|
||||
|
||||
printf "\n";
|
||||
done_testing($tests);
|
||||
|
Reference in New Issue
Block a user