jborg/attic

Tests failing on Gentoo Linux

Whissi opened this issue · 5 comments

Hi,

I am trying to bring attic to Gentoo Linux but tests are currently failing:

>>> Test phase: app-backup/attic-0.16
 * python3_4: running distutils-r1_run_phase python_test
...........EEE.....EE.....EE..EEE.Error reading segment 2
Index object count mismatch. 41 != 0
....EE......EE........................s......sss..Error reading segment 1
Index object count mismatch. 6 != 3
Error reading segment 1
Index object count mismatch. 6 != 3
Error reading segment 1
attempting to recover /var/tmp/portage/app-backup/attic-0.16/temp/tmpz9j3r2er/repository/data/0/1
.....Error reading segment 0
Error reading segment 0
Error reading segment 0
attempting to recover /var/tmp/portage/app-backup/attic-0.16/temp/tmpoc0zknlo/repository/data/0/0
Adding commit tag to segment 0
..........Error reading segment 1
Index object count mismatch. 6 != 3
Error reading segment 1
Index object count mismatch. 6 != 3
Error reading segment 1
attempting to recover /var/tmp/portage/app-backup/attic-0.16/temp/tmp2_70rqep/repository/data/0/1
.....Error reading segment 0
Error reading segment 0
Error reading segment 0
attempting to recover /var/tmp/portage/app-backup/attic-0.16/temp/tmpx1ne6p3g/repository/data/0/0
Adding commit tag to segment 0
..............
======================================================================
ERROR: test_aes_counter_uniqueness_keyfile (attic.testsuite.archiver.ArchiverTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 435, in test_aes_counter_uniqueness_keyfile
    self.verify_aes_counter_uniqueness('keyfile')
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 422, in verify_aes_counter_uniqueness
    self.create_test_files()
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 165, in create_test_files
    xattr.setxattr(os.path.join(self.input_path, 'link1'), 'user.foo_symlink', b'bar_symlink', follow_symlinks=False)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 101, in setxattr
    _check(func(path, name, value, len(value) if value else 0, 0), path)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 36, in _check
    raise OSError(get_errno(), path)
PermissionError: [Errno 1] b'/var/tmp/portage/app-backup/attic-0.16/temp/tmphy8h5cn6/input/link1'

======================================================================
ERROR: test_aes_counter_uniqueness_passphrase (attic.testsuite.archiver.ArchiverTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 438, in test_aes_counter_uniqueness_passphrase
    self.verify_aes_counter_uniqueness('passphrase')
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 422, in verify_aes_counter_uniqueness
    self.create_test_files()
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 165, in create_test_files
    xattr.setxattr(os.path.join(self.input_path, 'link1'), 'user.foo_symlink', b'bar_symlink', follow_symlinks=False)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 101, in setxattr
    _check(func(path, name, value, len(value) if value else 0, 0), path)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 36, in _check
    raise OSError(get_errno(), path)
PermissionError: [Errno 1] b'/var/tmp/portage/app-backup/attic-0.16/temp/tmpr85lu1wc/input/link1'

======================================================================
ERROR: test_basic_functionality (attic.testsuite.archiver.ArchiverTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 172, in test_basic_functionality
    self.create_test_files()
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 165, in create_test_files
    xattr.setxattr(os.path.join(self.input_path, 'link1'), 'user.foo_symlink', b'bar_symlink', follow_symlinks=False)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 101, in setxattr
    _check(func(path, name, value, len(value) if value else 0, 0), path)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 36, in _check
    raise OSError(get_errno(), path)
PermissionError: [Errno 1] b'/var/tmp/portage/app-backup/attic-0.16/temp/tmpwhcuty4p/input/link1'

======================================================================
ERROR: test_fuse_mount_archive (attic.testsuite.archiver.ArchiverTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 390, in test_fuse_mount_archive
    self.create_test_files()
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 165, in create_test_files
    xattr.setxattr(os.path.join(self.input_path, 'link1'), 'user.foo_symlink', b'bar_symlink', follow_symlinks=False)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 101, in setxattr
    _check(func(path, name, value, len(value) if value else 0, 0), path)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 36, in _check
    raise OSError(get_errno(), path)
PermissionError: [Errno 1] b'/var/tmp/portage/app-backup/attic-0.16/temp/tmpznydfsd4/input/link1'

======================================================================
ERROR: test_fuse_mount_repository (attic.testsuite.archiver.ArchiverTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 368, in test_fuse_mount_repository
    self.create_test_files()
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 165, in create_test_files
    xattr.setxattr(os.path.join(self.input_path, 'link1'), 'user.foo_symlink', b'bar_symlink', follow_symlinks=False)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 101, in setxattr
    _check(func(path, name, value, len(value) if value else 0, 0), path)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 36, in _check
    raise OSError(get_errno(), path)
PermissionError: [Errno 1] b'/var/tmp/portage/app-backup/attic-0.16/temp/tmp5gh232g5/input/link1'

======================================================================
ERROR: test_repository_swap_detection (attic.testsuite.archiver.ArchiverTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 202, in test_repository_swap_detection
    self.create_test_files()
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 165, in create_test_files
    xattr.setxattr(os.path.join(self.input_path, 'link1'), 'user.foo_symlink', b'bar_symlink', follow_symlinks=False)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 101, in setxattr
    _check(func(path, name, value, len(value) if value else 0, 0), path)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 36, in _check
    raise OSError(get_errno(), path)
PermissionError: [Errno 1] b'/var/tmp/portage/app-backup/attic-0.16/temp/tmptt8xw2w4/input/link1'

======================================================================
ERROR: test_repository_swap_detection2 (attic.testsuite.archiver.ArchiverTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 214, in test_repository_swap_detection2
    self.create_test_files()
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 165, in create_test_files
    xattr.setxattr(os.path.join(self.input_path, 'link1'), 'user.foo_symlink', b'bar_symlink', follow_symlinks=False)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 101, in setxattr
    _check(func(path, name, value, len(value) if value else 0, 0), path)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 36, in _check
    raise OSError(get_errno(), path)
PermissionError: [Errno 1] b'/var/tmp/portage/app-backup/attic-0.16/temp/tmpkkgu09tu/input/link1'

======================================================================
ERROR: test_aes_counter_uniqueness_keyfile (attic.testsuite.archiver.RemoteArchiverTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 435, in test_aes_counter_uniqueness_keyfile
    self.verify_aes_counter_uniqueness('keyfile')
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 422, in verify_aes_counter_uniqueness
    self.create_test_files()
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 165, in create_test_files
    xattr.setxattr(os.path.join(self.input_path, 'link1'), 'user.foo_symlink', b'bar_symlink', follow_symlinks=False)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 101, in setxattr
    _check(func(path, name, value, len(value) if value else 0, 0), path)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 36, in _check
    raise OSError(get_errno(), path)
PermissionError: [Errno 1] b'/var/tmp/portage/app-backup/attic-0.16/temp/tmp_aya7ji4/input/link1'

======================================================================
ERROR: test_aes_counter_uniqueness_passphrase (attic.testsuite.archiver.RemoteArchiverTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 438, in test_aes_counter_uniqueness_passphrase
    self.verify_aes_counter_uniqueness('passphrase')
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 422, in verify_aes_counter_uniqueness
    self.create_test_files()
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 165, in create_test_files
    xattr.setxattr(os.path.join(self.input_path, 'link1'), 'user.foo_symlink', b'bar_symlink', follow_symlinks=False)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 101, in setxattr
    _check(func(path, name, value, len(value) if value else 0, 0), path)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 36, in _check
    raise OSError(get_errno(), path)
PermissionError: [Errno 1] b'/var/tmp/portage/app-backup/attic-0.16/temp/tmptv1f6lnm/input/link1'

======================================================================
ERROR: test_basic_functionality (attic.testsuite.archiver.RemoteArchiverTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 172, in test_basic_functionality
    self.create_test_files()
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 165, in create_test_files
    xattr.setxattr(os.path.join(self.input_path, 'link1'), 'user.foo_symlink', b'bar_symlink', follow_symlinks=False)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 101, in setxattr
    _check(func(path, name, value, len(value) if value else 0, 0), path)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 36, in _check
    raise OSError(get_errno(), path)
PermissionError: [Errno 1] b'/var/tmp/portage/app-backup/attic-0.16/temp/tmp4z1pdnys/input/link1'

======================================================================
ERROR: test_fuse_mount_archive (attic.testsuite.archiver.RemoteArchiverTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 390, in test_fuse_mount_archive
    self.create_test_files()
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 165, in create_test_files
    xattr.setxattr(os.path.join(self.input_path, 'link1'), 'user.foo_symlink', b'bar_symlink', follow_symlinks=False)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 101, in setxattr
    _check(func(path, name, value, len(value) if value else 0, 0), path)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 36, in _check
    raise OSError(get_errno(), path)
PermissionError: [Errno 1] b'/var/tmp/portage/app-backup/attic-0.16/temp/tmpsttkbf82/input/link1'

======================================================================
ERROR: test_fuse_mount_repository (attic.testsuite.archiver.RemoteArchiverTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 368, in test_fuse_mount_repository
    self.create_test_files()
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 165, in create_test_files
    xattr.setxattr(os.path.join(self.input_path, 'link1'), 'user.foo_symlink', b'bar_symlink', follow_symlinks=False)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 101, in setxattr
    _check(func(path, name, value, len(value) if value else 0, 0), path)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 36, in _check
    raise OSError(get_errno(), path)
PermissionError: [Errno 1] b'/var/tmp/portage/app-backup/attic-0.16/temp/tmpg31mv8v1/input/link1'

======================================================================
ERROR: test_repository_swap_detection (attic.testsuite.archiver.RemoteArchiverTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 202, in test_repository_swap_detection
    self.create_test_files()
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 165, in create_test_files
    xattr.setxattr(os.path.join(self.input_path, 'link1'), 'user.foo_symlink', b'bar_symlink', follow_symlinks=False)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 101, in setxattr
    _check(func(path, name, value, len(value) if value else 0, 0), path)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 36, in _check
    raise OSError(get_errno(), path)
PermissionError: [Errno 1] b'/var/tmp/portage/app-backup/attic-0.16/temp/tmph8_7kq00/input/link1'

======================================================================
ERROR: test_repository_swap_detection2 (attic.testsuite.archiver.RemoteArchiverTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 214, in test_repository_swap_detection2
    self.create_test_files()
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/testsuite/archiver.py", line 165, in create_test_files
    xattr.setxattr(os.path.join(self.input_path, 'link1'), 'user.foo_symlink', b'bar_symlink', follow_symlinks=False)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 101, in setxattr
    _check(func(path, name, value, len(value) if value else 0, 0), path)
  File "/var/tmp/portage/app-backup/attic-0.16/work/Attic-0.16-python3_4/lib/attic/xattr.py", line 36, in _check
    raise OSError(get_errno(), path)
PermissionError: [Errno 1] b'/var/tmp/portage/app-backup/attic-0.16/temp/tmp4ammoe56/input/link1'

----------------------------------------------------------------------
Ran 118 tests in 15.627s

FAILED (errors=14, skipped=4)
Key file "/var/tmp/portage/app-backup/attic-0.16/temp/tmpwhfzkmot/var_tmp_portage_app_backup_attic_0_16_temp_tmplru8yk3l" created.
Keep this file safe. Your data will be inaccessible without it.
Remember your passphrase. Your data will be inaccessible without it.
Encryption NOT enabled.
Use the "--encryption=passphrase|keyfile" to enable encryption

I am calling the tests with fakeroot -u "${PYTHON}" -m attic.testsuite.run from docs dir in the pypi package.

Anything I can try to fix this?

Version information:

dev-libs/openssl-1.0.2d-r2
dev-lang/python-3.4.3-r2
dev-python/msgpack-0.4.6
dev-python/llfuse-0.41

There are a lot of PermissionErrors in there. Maybe check fs permissions.

Whissi, have you found a solution, or at least the reason behind the fail? My failed test output looks quite similar to yours. I am on CentOS 6.7.

Well, not really fixed but see https://github.com/borgbackup/borg/blob/master/borg/testsuite/archiver.py#L276-L280 from attic's borg fork.

When I remove the

xattr.setxattr(os.path.join(self.input_path, 'link1'), 'user.foo_symlink', b'bar_symlink', follow_symlinks=False)

line, the test suite will pass (well, you still have to deal with fuse but that's OK).

oops, totally forgot about that.

So this applies to my problem too?
#364

So xattr.setxattr() is only called in those subtests that are failing for me?

Do I understand correctly that this is about setting xattrs on symlinks?