Skip to content

Commit f29f93c

Browse files
committed
Backport from 3.3dev
... to avoid repeated failures because of heise.de . Looks like there are server side measures which made some tests fail. Often the MacOS CI runner is slower and seems to run into that. See also 56c1e58
1 parent 5d275e5 commit f29f93c

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

t/32_isHTML_valid.t

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ use Text::Diff;
1010

1111
my $tests = 0;
1212
my $prg="./testssl.sh";
13-
my $uri="heise.de";
13+
my $uri="github.com";
1414
my $out="";
1515
my $html="";
1616
my $debughtml="";
1717
my $edited_html="";
1818
my $htmlfile="tmp.html";
19-
my $check2run="--ip=one --sneaky --ids-friendly --color 0 --htmlfile $htmlfile";
19+
# Pick /usr/bin/openssl as we want to avoid the debug messages like "Your ./bin/openssl.Linux.x86_64 doesn't support X25519"
20+
my $check2run="--ip=one -4 --openssl /usr/bin/openssl --sneaky --ids-friendly --color 0 --htmlfile $htmlfile";
2021
my $diff="";
22+
my $ip="";
2123
die "Unable to open $prg" unless -f $prg;
2224

2325
printf "\n%s\n", "Doing HTML output checks";
@@ -54,6 +56,13 @@ ok($edited_html eq $out, "Checking if HTML file matches terminal output") or
5456
$tests++;
5557

5658

59+
if ( $^O eq "darwin" ){
60+
printf "\nskip debug check on MacOS\n\n";
61+
done_testing($tests);
62+
exit 0;
63+
}
64+
65+
5766
#2
5867
printf "%s\n", " .. running again $prg against \"$uri\", now with --debug 4 to create HTML output (may take another ~2 minutes)";
5968
# Redirect stderr to /dev/null in order to avoid some unexplained "date: invalid date" error messages
@@ -78,8 +87,21 @@ $debughtml =~ s/.*DEBUG:.*\n//g;
7887
$debughtml =~ s/No engine or GOST support via engine with your.*\n//g;
7988
$debughtml =~ s/.*built: .*\n//g;
8089
$debughtml =~ s/.*Using bash .*\n//g;
90+
$debughtml =~ s/.*has_compression.*\n//g;
8191
# is whole line: s/.*<pattern> .*\n//g;
8292

93+
# Extract and mask IP address as it can change
94+
if ( $html =~ /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/ ) {
95+
$ip = $1;
96+
}
97+
$html =~ s/$ip/AAA.BBB.CCC.DDD/g;
98+
99+
if ( $debughtml =~ /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/ ) {
100+
$ip = $1;
101+
}
102+
$debughtml =~ s/$ip/AAA.BBB.CCC.DDD/g;
103+
104+
83105
$diff = diff \$debughtml, \$html;
84106

85107
ok($debughtml eq $html, "Checking if HTML file created with --debug 4 matches HTML file created without --debug") or

0 commit comments

Comments
 (0)