|
56 | 56 | from ..logger import setup_logging |
57 | 57 | from ..remote import RemoteRepository, PathNotAllowed |
58 | 58 | from ..repository import Repository |
59 | | -from . import has_lchflags, llfuse |
| 59 | +from . import has_lchflags, has_mknod, llfuse |
60 | 60 | from . import BaseTestCase, changedir, environment_variable, no_selinux, same_ts_ns, granularity_sleep |
61 | 61 | from . import are_symlinks_supported, are_hardlinks_supported, are_fifos_supported, is_utime_fully_supported, is_birthtime_fully_supported |
62 | 62 | from .platform import fakeroot_detected, is_darwin, is_freebsd, is_win32 |
@@ -367,10 +367,11 @@ def create_test_files(self, create_hardlinks=True): |
367 | 367 | if has_lchflags: |
368 | 368 | platform.set_flags(os.path.join(self.input_path, 'flagfile'), stat.UF_NODUMP) |
369 | 369 | try: |
370 | | - # Block device |
371 | | - os.mknod('input/bdev', 0o600 | stat.S_IFBLK, os.makedev(10, 20)) |
372 | | - # Char device |
373 | | - os.mknod('input/cdev', 0o600 | stat.S_IFCHR, os.makedev(30, 40)) |
| 370 | + if has_mknod: |
| 371 | + # Block device |
| 372 | + os.mknod('input/bdev', 0o600 | stat.S_IFBLK, os.makedev(10, 20)) |
| 373 | + # Char device |
| 374 | + os.mknod('input/cdev', 0o600 | stat.S_IFCHR, os.makedev(30, 40)) |
374 | 375 | # File mode |
375 | 376 | os.chmod('input/dir2', 0o555) # if we take away write perms, we need root to remove contents |
376 | 377 | # File owner |
@@ -426,8 +427,8 @@ def test_basic_functionality(self): |
426 | 427 | expected.append('input/link1') |
427 | 428 | if are_hardlinks_supported(): |
428 | 429 | expected.append('input/hardlink') |
429 | | - if not have_root: |
430 | | - # we could not create these device files without (fake)root |
| 430 | + if not have_root or not has_mknod: |
| 431 | + # we could not create these device files without (fake)root or without os.mknod |
431 | 432 | expected.remove('input/bdev') |
432 | 433 | expected.remove('input/cdev') |
433 | 434 | if has_lchflags: |
|
0 commit comments