From b8aadef73769ff68084a6ace8fa32ee1452ffb46 Mon Sep 17 00:00:00 2001 From: Dirk Wetter Date: Tue, 8 Jul 2025 23:47:19 +0200 Subject: [PATCH] For Mac: use homebrew's openssl (3.2) ... so that we have a comparison between OpenSSL and LibreSSL. Otherwise this test would be completely futile for MacOS. Also change the displayed text. --- t/12_diff_opensslversions.t | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/t/12_diff_opensslversions.t b/t/12_diff_opensslversions.t index 5262463..91d3262 100755 --- a/t/12_diff_opensslversions.t +++ b/t/12_diff_opensslversions.t @@ -20,6 +20,8 @@ my $uri="google.com"; my $diff=""; my $distro_openssl="/usr/bin/openssl"; my @args=""; +# that can be done better but I am a perl n00b ;-) +my $os=`perl -e 'print "$^O";'`; die "Unable to open $prg" unless -f $prg; die "Unable to open $distro_openssl" unless -f $distro_openssl; @@ -29,13 +31,22 @@ unlink $csvfile; unlink $csvfile2; #1 run -printf "\n%s\n", "Diff test IPv4 with supplied openssl against \"$uri\""; -@args="$prg $check2run $csvfile $uri >/dev/null"; + +if ( $os eq "linux" ){ + printf "\n%s\n", "Test with supplied openssl against \"$uri\" and save it"; + @args="$prg $check2run $csvfile $uri >/dev/null"; +} elsif ( $os eq "darwin" ){ + # macos silicon doesn't have ~/bin/openssl.Darwin.arm64 binary so we use the + # homebrew version which was moved to /opt/homebrew/bin/openssl.NOPE in + # .github/workflows/unit_tests_macos.yml + printf "\n%s\n", "Test with homebrew's openssl 3.5.x against \"$uri\" and save it"; + @args="$prg $check2run $csvfile --openssl /opt/homebrew/bin/openssl.NOPE $uri >/dev/null"; +} system("@args") == 0 or die ("FAILED: \"@args\""); # 2 -printf "\n%s\n", "Diff test IPv4 with $distro_openssl against \"$uri\""; +printf "\n%s\n", "Test with $distro_openssl against \"$uri\" and save it"; @args="$prg $check2run $csvfile2 --openssl=$distro_openssl $uri >/dev/null"; system("@args") == 0 or die ("FAILED: \"@args\" ");