From: Simon Ruderich Date: Sun, 19 Oct 2025 08:21:00 +0000 (+0200) Subject: Fix tests on FreeBSD and OpenBSD X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=e5b43524af339d35d90d719f653fb6fb6f0fee18;p=safcm%2Fsafcm.git Fix tests on FreeBSD and OpenBSD Broken in 5141405 (Update dependencies, static checkers and Go to 1.24, 2025-10-17) which switched from manually creating the directory to using t.TempDir(). --- diff --git a/remote/sync/files_test.go b/remote/sync/files_test.go index 9376413..1803e08 100644 --- a/remote/sync/files_test.go +++ b/remote/sync/files_test.go @@ -806,6 +806,12 @@ func TestSyncFiles(t *testing.T) { if err != nil { t.Fatal(err) } + // On BSD systems directories created under /tmp inherit the wheel + // group which would break the tests. + err = os.Chown(path, os.Getuid(), os.Getgid()) + if err != nil { + t.Fatal(err) + } t.Chdir(path) if tc.prepare != nil { @@ -2542,6 +2548,12 @@ file if err != nil { t.Fatal(err) } + // On BSD systems directories created under /tmp inherit the wheel + // group which would break the tests. + err = os.Chown(path, os.Getuid(), os.Getgid()) + if err != nil { + t.Fatal(err) + } t.Chdir(path) if tc.prepare != nil {