Skip to content

Commit b8086f0

Browse files
committed
Fix tests to work on macOS Ventura
Shell utilities included in Ventura do not behave the same as GNU core utilities, and OpenSSL has been replaced with LibreSSL.
1 parent eacc2e8 commit b8086f0

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

internal/pki/pki_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,9 @@ func strictOpenSSLVerify(t *testing.T, openssl string, root, leaf Certificate) {
491491
if !strings.Contains(string(output), "-x509_strict") {
492492
t.Skip(`requires "-x509_strict" flag`)
493493
}
494+
if !strings.Contains(string(output), "-no-CAfile") {
495+
t.Skip(`requires a flag to ignore system certificates`)
496+
}
494497

495498
verify := func(t testing.TB, args ...string) {
496499
t.Helper()

internal/postgres/config_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,11 @@ func TestBashRecreateDirectory(t *testing.T) {
209209
}
210210

211211
func TestBashSafeLink(t *testing.T) {
212-
// macOS lacks `realpath` which is part of GNU coreutils.
213-
if _, err := exec.LookPath("realpath"); err != nil {
214-
t.Skip(`requires "realpath" executable`)
212+
// macOS `mv` takes different arguments than GNU coreutils.
213+
if output, err := exec.Command("mv", "--help").CombinedOutput(); err != nil {
214+
t.Skip(`requires "mv" executable`)
215+
} else if !strings.Contains(string(output), "no-target-directory") {
216+
t.Skip(`requires "mv" that overwrites a directory symlink`)
215217
}
216218

217219
// execute calls the bash function with args.

0 commit comments

Comments
 (0)