From b929e0c5af76b888208ee55202df129da555fc0f Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 9 Nov 2025 19:03:49 +0100 Subject: [PATCH 1/2] freebsd/netbsd: skip test_hard_link_deletion_and_replacement, #9147, #9153 The test fails on these platforms. I could not find the root cause of this issue, but it is likely a minor problem with ctime and doesn't affect borg usage much. So I rather like to have CI on freebsd/netbsd not failing because of this. Also: add is_netbsd and is_openbsd to platformflags. --- src/borg/platformflags.py | 2 ++ src/borg/testsuite/archiver/diff_cmd_test.py | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/borg/platformflags.py b/src/borg/platformflags.py index da4e5f6fe..f13361fad 100644 --- a/src/borg/platformflags.py +++ b/src/borg/platformflags.py @@ -11,4 +11,6 @@ is_cygwin = sys.platform.startswith("cygwin") is_linux = sys.platform.startswith("linux") is_freebsd = sys.platform.startswith("freebsd") +is_netbsd = sys.platform.startswith("netbsd") +is_openbsd = sys.platform.startswith("openbsd") is_darwin = sys.platform.startswith("darwin") diff --git a/src/borg/testsuite/archiver/diff_cmd_test.py b/src/borg/testsuite/archiver/diff_cmd_test.py index 155d654b7..3f6b7326e 100644 --- a/src/borg/testsuite/archiver/diff_cmd_test.py +++ b/src/borg/testsuite/archiver/diff_cmd_test.py @@ -7,7 +7,7 @@ import pytest from ...constants import * # NOQA from .. import are_symlinks_supported, are_hardlinks_supported, granularity_sleep -from ...platformflags import is_win32 +from ...platformflags import is_win32, is_freebsd, is_netbsd from . import ( cmd, create_regular_file, @@ -426,7 +426,10 @@ def test_sort_by_all_keys_with_directions(archivers, request, sort_key): assert seen_paths == expected_paths -@pytest.mark.skipif(not are_hardlinks_supported(), reason="hardlinks not supported") +@pytest.mark.skipif( + not are_hardlinks_supported() or is_freebsd or is_netbsd, + reason="hardlinks not supported or test failing on freebsd and netbsd", +) def test_hard_link_deletion_and_replacement(archivers, request): archiver = request.getfixturevalue(archivers) From 1589489bdae5356998c407494bc68a38c01b71df Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 9 Nov 2025 19:47:10 +0100 Subject: [PATCH 2/2] netbsd: work around failure in test_basic_functionality, #8703 I could not find the root cause of this issue, but it is likely a minor problem with ctime and doesn't affect borg usage much. So I rather like to have CI on netbsd not failing because of this. --- src/borg/testsuite/archiver/diff_cmd_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/borg/testsuite/archiver/diff_cmd_test.py b/src/borg/testsuite/archiver/diff_cmd_test.py index 3f6b7326e..f726773e7 100644 --- a/src/borg/testsuite/archiver/diff_cmd_test.py +++ b/src/borg/testsuite/archiver/diff_cmd_test.py @@ -176,7 +176,8 @@ def test_basic_functionality(archivers, request): assert unexpected not in get_changes("input/file_touched", joutput) if not content_only: # on win32, ctime is the file creation time and does not change. - expected = {"mtime"} if is_win32 else {"mtime", "ctime"} + # not sure why netbsd only has mtime, but it does, #8703. + expected = {"mtime"} if (is_win32 or is_netbsd) else {"mtime", "ctime"} assert expected.issubset({c["type"] for c in get_changes("input/file_touched", joutput)}) else: # And if we're doing content-only, don't show the file at all.