Skip to content

Commit af707b8

Browse files
freebsd/netbsd: skip some tests we have github issues for
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. tests(diff): on NetBSD only expect mtime for touched file in JSON diff (treat like Windows); completes backport of #9161 to 1.4-maint layout tests(diff): also skip DiffArchiverTestCase.test_multiple_link_exclusion when hardlinks unsupported (include are_hardlinks_supported in skip)
1 parent 0a553dd commit af707b8

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/borg/platformflags.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@
99
is_win32 = sys.platform.startswith('win32')
1010
is_linux = sys.platform.startswith('linux')
1111
is_freebsd = sys.platform.startswith('freebsd')
12+
is_netbsd = sys.platform.startswith('netbsd')
13+
is_openbsd = sys.platform.startswith('openbsd')
1214
is_darwin = sys.platform.startswith('darwin')

src/borg/testsuite/archiver.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
from . import has_lchflags, has_mknod, llfuse
6060
from . import BaseTestCase, changedir, environment_variable, no_selinux, same_ts_ns, granularity_sleep
6161
from . import are_symlinks_supported, are_hardlinks_supported, are_fifos_supported, is_utime_fully_supported, is_birthtime_fully_supported
62-
from .platform import fakeroot_detected, is_darwin, is_freebsd, is_win32
62+
from .platform import fakeroot_detected, is_darwin, is_freebsd, is_netbsd, is_win32
6363
from .upgrader import make_attic_repo
6464
from . import key
6565

@@ -4880,7 +4880,10 @@ def get_changes(filename, data):
48804880
unexpected = {'type': 'modified', 'added': 0, 'removed': 0}
48814881
assert unexpected not in get_changes('input/file_touched', joutput)
48824882
if not content_only:
4883-
assert {"ctime", "mtime"}.issubset({c["type"] for c in get_changes('input/file_touched', joutput)})
4883+
# On Windows, ctime is the creation time and does not change on touch.
4884+
# NetBSD also only reports mtime here, see #8703 (backport of #9161 intent).
4885+
expected = {"mtime"} if (is_win32 or is_netbsd) else {"ctime", "mtime"}
4886+
assert expected.issubset({c["type"] for c in get_changes('input/file_touched', joutput)})
48844887
else:
48854888
# And if we're doing content-only, don't show the file at all.
48864889
assert not any(get_changes('input/file_touched', joutput))
@@ -5075,6 +5078,10 @@ def test_time_diffs(self):
50755078

50765079

50775080
@requires_hardlinks
5081+
@pytest.mark.skipif(
5082+
(not are_hardlinks_supported()) or is_freebsd or is_netbsd,
5083+
reason='Skip when hardlinks unsupported or on FreeBSD/NetBSD due to differing ctime/link handling; see #9147, #9153.',
5084+
)
50785085
def test_multiple_link_exclusion(self):
50795086
path_a = os.path.join(self.input_path, 'a')
50805087
path_b = os.path.join(self.input_path, 'b')

src/borg/testsuite/platform.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import tempfile
77
import unittest
88

9-
from ..platformflags import is_win32, is_linux, is_freebsd, is_darwin
9+
from ..platformflags import is_win32, is_linux, is_freebsd, is_netbsd, is_darwin
1010
from ..platform import acl_get, acl_set, swidth
1111
from ..platform import get_process_id, process_alive
1212
from . import BaseTestCase, unopened_tempfile

0 commit comments

Comments
 (0)