1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-24 08:45:13 +00:00

tests: ignore st_rdev if file is not a block/char device, fixes #203

This commit is contained in:
Thomas Waldmann 2015-09-17 22:41:49 +02:00
parent ff64b4c424
commit 48634d4e96

View file

@ -2,6 +2,7 @@
import filecmp
import os
import posix
import stat
import sys
import sysconfig
import time
@ -72,6 +73,11 @@ def _assert_dirs_equal_cmp(self, diff):
attrs.append('st_nlink')
d1 = [filename] + [getattr(s1, a) for a in attrs]
d2 = [filename] + [getattr(s2, a) for a in attrs]
# ignore st_rdev if file is not a block/char device, fixes #203
if not stat.S_ISCHR(d1[1]) and not stat.S_ISBLK(d1[1]):
d1[4] = None
if not stat.S_ISCHR(d2[1]) and not stat.S_ISBLK(d2[1]):
d2[4] = None
if not os.path.islink(path1) or utime_supports_fd:
# Older versions of llfuse do not support ns precision properly
if fuse and not have_fuse_mtime_ns: