From 424b87d1d3c7b62a01563db767fd30c7074ff8ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 25 Jul 2022 13:03:46 +0200 Subject: [PATCH] Shaman tests: ensure the temporary storage path is not a symlink Shaman cannot handle cases where the storage path is a symlink (i.e. cases where `filepath.EvalSymlinks(storagePath)` does not return `storagePath`). This caused macOS devices to fail the unit tests, because macOS uses a symlinked path for temporary files. This commit changes the unit tests, to always use the real path instead of the OS-provided symlink. This does *not* fix the actual issue in Shaman, for that see T99965. --- pkg/shaman/config/testing.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/shaman/config/testing.go b/pkg/shaman/config/testing.go index 4da32890..61f26ee4 100644 --- a/pkg/shaman/config/testing.go +++ b/pkg/shaman/config/testing.go @@ -25,6 +25,7 @@ package config import ( "io/ioutil" "os" + "path/filepath" "time" ) @@ -35,6 +36,11 @@ func CreateTestConfig() (conf Config, cleanup func()) { panic(err) } + tempDir, err = filepath.EvalSymlinks(tempDir) + if err != nil { + panic(err) + } + conf = Config{ TestTempDir: tempDir, Enabled: true,