Skip to content

Commit dd17f20

Browse files
committed
For mac use homebrew's openssl
... so that we have a comparison between OpenSSL and LibreSSL. Otherwise this test would be completely futile for MacOS. Also change the diplayed text.
1 parent a4d6f9a commit dd17f20

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

t/12_diff_opensslversions.t

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ my $uri="google.com";
2020
my $diff="";
2121
my $distro_openssl="/usr/bin/openssl";
2222
my @args="";
23+
# that can be done better but I am a perl n00b ;-)
24+
my $os=`perl -e 'print "$^O";'`;
2325

2426
die "Unable to open $prg" unless -f $prg;
2527
die "Unable to open $distro_openssl" unless -f $distro_openssl;
@@ -29,13 +31,22 @@ unlink $csvfile;
2931
unlink $csvfile2;
3032

3133
#1 run
32-
printf "\n%s\n", "Diff test IPv4 with supplied openssl against \"$uri\"";
33-
@args="$prg $check2run $csvfile $uri >/dev/null";
34+
35+
if ( $os eq "linux" ){
36+
printf "\n%s\n", "Test with supplied openssl against \"$uri\" and save it";
37+
@args="$prg $check2run $csvfile $uri >/dev/null";
38+
} elsif ( $os eq "darwin" ){
39+
# macos silicon doesn't have ~/bin/openssl.Darwin.arm64 binary so we use the
40+
# homebrew version which was moved to /opt/homebrew/bin/openssl.NOPE in
41+
# .github/workflows/unit_tests_macos.yml
42+
printf "\n%s\n", "Test with homebrew's openssl 3.5.x against \"$uri\" and save it";
43+
@args="$prg $check2run $csvfile --openssl /opt/homebrew/bin/openssl.NOPE $uri >/dev/null";
44+
}
3445
system("@args") == 0
3546
or die ("FAILED: \"@args\"");
3647

3748
# 2
38-
printf "\n%s\n", "Diff test IPv4 with $distro_openssl against \"$uri\"";
49+
printf "\n%s\n", "Test with $distro_openssl against \"$uri\" and save it";
3950
@args="$prg $check2run $csvfile2 --openssl=$distro_openssl $uri >/dev/null";
4051
system("@args") == 0
4152
or die ("FAILED: \"@args\" ");

0 commit comments

Comments
 (0)