librelist archives

« back to archive

test failures

test failures

From:
Dan Christensen
Date:
2014-02-03 @ 21:17
I'm getting some test errors on my system.  Not sure if they are
because I'm not set up correctly for development, or if there is some
other reason.  There are nine errors in total, of two different types.

One involves

  File 
"/home/jdc/.local/lib/python3.2/site-packages/Attic-0.10_3_gd3ff6ac-py3.2-linux-x86_64.egg/attic/helpers.py",
line 45, in upgrade
    fcntl.lockf(self.fd, fcntl.LOCK_EX)
IOError: [Errno 9] Bad file descriptor

and the other eight involve

  File 
"/home/jdc/.local/lib/python3.2/site-packages/Attic-0.10_3_gd3ff6ac-py3.2-linux-x86_64.egg/attic/testsuite/archiver.py",
line 112, in create_test_files
    os.chown('input/file1', 100, 200)
OSError: [Errno 1] Operation not permitted: 'input/file1'

Those were run as a regular user.  I tried running with

  fakeroot python3 run.py -v

and then I got no errors, but two failures.  (Also two skipped, one
because I was root, and one because I don't have xattr on this
filesystem.)  The log from this run is below.  I'm guessing the
two failures are because I used fakeroot.

Should tests really be run as root?  Can they be made to work 
with fakeroot?

Dan

jdc@jdc:~/computers/backups/attic/attic/testsuite$ fakeroot python3 run.py -v
test (attic.testsuite.helpers.FormatTimedeltaTestCase) ... ok
test (attic.testsuite.helpers.LocationTestCase) ... ok
test (attic.testsuite.helpers.MakePathSafeTestCase) ... ok
test (attic.testsuite.helpers.PatternTestCase) ... ok
test (attic.testsuite.helpers.PruneSplitTestCase) ... ok
test (attic.testsuite.helpers.UpgradableLockTestCase) ... ok
test_read_only_lock_file (attic.testsuite.helpers.UpgradableLockTestCase) 
... skipped 'Root can always open files for writing'
test_aes (attic.testsuite.crypto.CryptoTestCase) ... ok
test_bytes_to_int (attic.testsuite.crypto.CryptoTestCase) ... ok
test_bytes_to_long (attic.testsuite.crypto.CryptoTestCase) ... ok
test_get_random_bytes (attic.testsuite.crypto.CryptoTestCase) ... ok
test_pbkdf2_sha256 (attic.testsuite.crypto.CryptoTestCase) ... ok
test_buzhash (attic.testsuite.chunker.ChunkerTestCase) ... ok
test_chunkify (attic.testsuite.chunker.ChunkerTestCase) ... ok
test1 (attic.testsuite.repository.RemoteRepositoryTestCase) ... ok
test2 (attic.testsuite.repository.RemoteRepositoryTestCase)
Test multiple sequential transactions ... ok
test_consistency (attic.testsuite.repository.RemoteRepositoryTestCase)
Test cache consistency ... ok
test_consistency2 (attic.testsuite.repository.RemoteRepositoryTestCase)
Test cache consistency2 ... ok
test_index_rebuild (attic.testsuite.repository.RemoteRepositoryTestCase)
Verify that repository index rebuild works properly ... ok
test_single_kind_transactions 
(attic.testsuite.repository.RemoteRepositoryTestCase) ... ok
test1 (attic.testsuite.repository.RepositoryTestCase) ... ok
test2 (attic.testsuite.repository.RepositoryTestCase)
Test multiple sequential transactions ... ok
test_consistency (attic.testsuite.repository.RepositoryTestCase)
Test cache consistency ... ok
test_consistency2 (attic.testsuite.repository.RepositoryTestCase)
Test cache consistency2 ... ok
test_index_rebuild (attic.testsuite.repository.RepositoryTestCase)
Verify that repository index rebuild works properly ... ok
test_single_kind_transactions 
(attic.testsuite.repository.RepositoryTestCase) ... ok
test (attic.testsuite.lrucache.LRUCacheTestCase) ... ok
test_pop (attic.testsuite.lrucache.LRUCacheTestCase) ... ok
test_chunkindex (attic.testsuite.hashindex.HashIndexTestCase) ... ok
test_nsindex (attic.testsuite.hashindex.HashIndexTestCase) ... ok
test_read_only (attic.testsuite.hashindex.HashIndexTestCase)
Make sure read_only indices work even they contain a lot of tombstones ... ok
test_resize (attic.testsuite.hashindex.HashIndexTestCase) ... ok
test (attic.testsuite.archive.ChunkBufferTestCase) ... ok
test_keyfile (attic.testsuite.key.KeyTestCase) ... Key file 
"/tmp/tmphlf5fh/tmp_tmprqn85y" created.
Keep this file safe. Your data will be inaccessible without it.
ok
test_keyfile2 (attic.testsuite.key.KeyTestCase) ... ok
test_passphrase (attic.testsuite.key.KeyTestCase) ... Remember your 
passphrase. Your data will be inaccessible without it.
ok
test_plaintext (attic.testsuite.key.KeyTestCase) ... Encryption NOT enabled.
Use the "--encryption=passphrase|keyfile" to enable encryption.
ok
test_aes_counter_uniqueness_keyfile 
(attic.testsuite.archiver.ArchiverTestCase) ... ok
test_aes_counter_uniqueness_passphrase 
(attic.testsuite.archiver.ArchiverTestCase) ... ok
test_basic_functionality (attic.testsuite.archiver.ArchiverTestCase) ... ok
test_corrupted_repository (attic.testsuite.archiver.ArchiverTestCase) ... ok
test_delete (attic.testsuite.archiver.ArchiverTestCase) ... ok
test_extract_include_exclude (attic.testsuite.archiver.ArchiverTestCase) ... ok
test_mount (attic.testsuite.archiver.ArchiverTestCase) ... ERROR: ld.so: 
object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be 
preloaded: ignored.
FAIL
test_overwrite (attic.testsuite.archiver.ArchiverTestCase) ... ok
test_path_normalization (attic.testsuite.archiver.ArchiverTestCase) ... ok
test_prune_repository (attic.testsuite.archiver.ArchiverTestCase) ... ok
test_readonly_repository (attic.testsuite.archiver.ArchiverTestCase) ... ok
test_usage (attic.testsuite.archiver.ArchiverTestCase) ... ok
test_aes_counter_uniqueness_keyfile 
(attic.testsuite.archiver.RemoteArchiverTestCase) ... ok
test_aes_counter_uniqueness_passphrase 
(attic.testsuite.archiver.RemoteArchiverTestCase) ... ok
test_basic_functionality (attic.testsuite.archiver.RemoteArchiverTestCase) ... ok
test_corrupted_repository (attic.testsuite.archiver.RemoteArchiverTestCase) ... ok
test_delete (attic.testsuite.archiver.RemoteArchiverTestCase) ... ok
test_extract_include_exclude 
(attic.testsuite.archiver.RemoteArchiverTestCase) ... ok
test_mount (attic.testsuite.archiver.RemoteArchiverTestCase) ... ERROR: 
ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded: 
ignored.
ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be 
preloaded: ignored.
FAIL
test_overwrite (attic.testsuite.archiver.RemoteArchiverTestCase) ... ok
test_path_normalization (attic.testsuite.archiver.RemoteArchiverTestCase) ... ok
test_prune_repository (attic.testsuite.archiver.RemoteArchiverTestCase) ... ok
test_readonly_repository (attic.testsuite.archiver.RemoteArchiverTestCase) ... ok
test_usage (attic.testsuite.archiver.RemoteArchiverTestCase) ... ok
test (attic.testsuite.xattr.XattrTestCase) ... skipped 'xattr not enabled 
on filesystem'

======================================================================
FAIL: test_mount (attic.testsuite.archiver.ArchiverTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/home/jdc/.local/lib/python3.2/site-packages/Attic-0.10_3_gd3ff6ac-py3.2-linux-x86_64.egg/attic/testsuite/archiver.py",
line 248, in test_mount
    self.assert_dirs_equal(self.input_path, os.path.join(mountpoint, 'input'))
  File 
"/home/jdc/.local/lib/python3.2/site-packages/Attic-0.10_3_gd3ff6ac-py3.2-linux-x86_64.egg/attic/testsuite/__init__.py",
line 44, in assert_dirs_equal
    self._assert_dirs_equal_cmp(diff)
  File 
"/home/jdc/.local/lib/python3.2/site-packages/Attic-0.10_3_gd3ff6ac-py3.2-linux-x86_64.egg/attic/testsuite/__init__.py",
line 73, in _assert_dirs_equal_cmp
    self.assert_equal(d1, d2)
AssertionError: Lists differ: ['file1', 36845, 100, 200, 0, ... != 
['file1', 36845, 0, 0, 0, 2, 1...

First differing element 2:
100
0

- ['file1', 36845, 100, 200, 0, 2, 1391461873000000000, {}]
?                  --   --

+ ['file1', 36845, 0, 0, 0, 2, 1391461873000000000, {}]

======================================================================
FAIL: test_mount (attic.testsuite.archiver.RemoteArchiverTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File 
"/home/jdc/.local/lib/python3.2/site-packages/Attic-0.10_3_gd3ff6ac-py3.2-linux-x86_64.egg/attic/testsuite/archiver.py",
line 248, in test_mount
    self.assert_dirs_equal(self.input_path, os.path.join(mountpoint, 'input'))
  File 
"/home/jdc/.local/lib/python3.2/site-packages/Attic-0.10_3_gd3ff6ac-py3.2-linux-x86_64.egg/attic/testsuite/__init__.py",
line 44, in assert_dirs_equal
    self._assert_dirs_equal_cmp(diff)
  File 
"/home/jdc/.local/lib/python3.2/site-packages/Attic-0.10_3_gd3ff6ac-py3.2-linux-x86_64.egg/attic/testsuite/__init__.py",
line 73, in _assert_dirs_equal_cmp
    self.assert_equal(d1, d2)
AssertionError: Lists differ: ['file1', 36845, 100, 200, 0, ... != 
['file1', 36845, 0, 0, 0, 2, 1...

First differing element 2:
100
0

- ['file1', 36845, 100, 200, 0, 2, 1391461892000000000, {}]
?                  --   --

+ ['file1', 36845, 0, 0, 0, 2, 1391461892000000000, {}]

----------------------------------------------------------------------
Ran 62 tests in 41.882s

FAILED (failures=2, skipped=2)

Re: [attic] test failures

From:
Jonas Borgström
Date:
2014-02-03 @ 22:07
On 2014-02-03 22:17, Dan Christensen wrote:
> I'm getting some test errors on my system.  Not sure if they are
> because I'm not set up correctly for development, or if there is some
> other reason.  There are nine errors in total, of two different types.
> 
> One involves
> 
>   File 
"/home/jdc/.local/lib/python3.2/site-packages/Attic-0.10_3_gd3ff6ac-py3.2-linux-x86_64.egg/attic/helpers.py",
line 45, in upgrade
>     fcntl.lockf(self.fd, fcntl.LOCK_EX)
> IOError: [Errno 9] Bad file descriptor
> 
> and the other eight involve
> 
>   File 
"/home/jdc/.local/lib/python3.2/site-packages/Attic-0.10_3_gd3ff6ac-py3.2-linux-x86_64.egg/attic/testsuite/archiver.py",
line 112, in create_test_files
>     os.chown('input/file1', 100, 200)
> OSError: [Errno 1] Operation not permitted: 'input/file1'
> 
> Those were run as a regular user.  I tried running with
> 
>   fakeroot python3 run.py -v
> 
> and then I got no errors, but two failures.  (Also two skipped, one
> because I was root, and one because I don't have xattr on this
> filesystem.)  The log from this run is below.  I'm guessing the
> two failures are because I used fakeroot.
> 
> Should tests really be run as root?  Can they be made to work 
> with fakeroot?

The test suite it intended to be run with "fakeroot -u".
I've just pushed a new README.rst with the correct way to run the test
suite:

fakeroot -u python -m attic.testsuite.run

If you're interested you can also have a look at ".travis.yml" to see
how travis-ci is configured

/ Jonas

Re: [attic] test failures

From:
Dan Christensen
Date:
2014-02-04 @ 00:19
Jonas Borgström <jonas@borgstrom.se> writes:

> The test suite it intended to be run with "fakeroot -u".
> I've just pushed a new README.rst with the correct way to run the test
> suite:
>
> fakeroot -u python -m attic.testsuite.run
>
> If you're interested you can also have a look at ".travis.yml" to see
> how travis-ci is configured

Thanks, that helped, and now all tests pass.  I also learned about

  cd /path/to/git/repo
  pip3 install -e . --user

which lets the git repo be directly available in python's search path.

Dan