Skip to content

Commit cacd8c5

Browse files
committed
Add variable htmlfile + filter GOST message
... which is needed for newer LibreSSL/OpenSSL versions
1 parent 2e33c48 commit cacd8c5

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

t/32_isHTML_valid.t

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,23 @@ my $out="";
1515
my $html="";
1616
my $debughtml="";
1717
my $edited_html="";
18-
my $check2run="--ip=one --ids-friendly --color 0 --htmlfile tmp.html";
18+
my $htmlfile="tmp.html";
19+
my $check2run="--ip=one --ids-friendly --color 0 --htmlfile $htmlfile";
1920
my $diff="";
2021
die "Unable to open $prg" unless -f $prg;
2122

2223
printf "\n%s\n", "Doing HTML output checks";
23-
unlink 'tmp.html';
24+
unlink $htmlfile;
2425

2526
#1
2627
printf "%s\n", " .. running $prg against \"$uri\" to create HTML and terminal outputs (may take ~2 minutes)";
2728
# specify a TERM_WIDTH so that the two calls to testssl.sh don't create HTML files with different values of TERM_WIDTH
2829
$out = `TERM_WIDTH=120 $prg $check2run $uri`;
29-
$html = `cat tmp.html`;
30+
$html = `cat $htmlfile`;
3031
# $edited_html will contain the HTML with formatting information removed in order to compare against terminal output
3132
# Start by removing the HTML header.
32-
$edited_html = `tail -n +11 tmp.html`;
33-
unlink 'tmp.html';
33+
$edited_html = `tail -n +11 $htmlfile`;
34+
unlink $htmlfile;
3435

3536
# Remove the HTML footer
3637
$edited_html =~ s/\n\<\/pre\>\n\<\/body\>\n\<\/html\>//;
@@ -51,12 +52,13 @@ $tests++;
5152
$diff = diff \$edited_html, \$out;
5253
printf "\n%s\n", "$diff";
5354

55+
5456
#2
5557
printf "\n%s\n", " .. running again $prg against \"$uri\", now with --debug 4 to create HTML output (may take another ~2 minutes)";
5658
# Redirect stderr to /dev/null in order to avoid some unexplained "date: invalid date" error messages
5759
$out = `TERM_WIDTH=120 $prg $check2run --debug 4 $uri 2> /dev/null`;
58-
$debughtml = `cat tmp.html`;
59-
unlink 'tmp.html';
60+
$debughtml = `cat $htmlfile`;
61+
unlink $htmlfile;
6062

6163
# Remove date information from the Start and Done banners in the two HTML files, since they were created at different times
6264
$html =~ s/Start 2[0-9][0-9][0-9]-[0-3][0-9]-[0-3][0-9] [0-2][0-9]:[0-5][0-9]:[0-5][0-9]/Start XXXX-XX-XX XX:XX:XX/;
@@ -72,6 +74,7 @@ $debughtml =~ s/HTTP clock skew \+?-?[0-9]* /HTTP clock skew
7274
$debughtml =~ s/ Pre-test: .*\n//g;
7375
$debughtml =~ s/.*OK: below 825 days.*\n//g;
7476
$debughtml =~ s/.*DEBUG:.*\n//g;
77+
$debughtml =~ s/No engine or GOST support via engine with your.*\n//g;
7578

7679
cmp_ok($debughtml, "eq", $html, "HTML file created with --debug 4 matches HTML file created without --debug");
7780
$tests++;

0 commit comments

Comments
 (0)