Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

st_rdev test fails on openbsd #203

Closed
ThomasWaldmann opened this issue Sep 14, 2015 · 1 comment
Closed

st_rdev test fails on openbsd #203

ThomasWaldmann opened this issue Sep 14, 2015 · 1 comment

Comments

@ThomasWaldmann
Copy link
Member

__________________ ArchiverTestCase.test_basic_functionality ___________________

self = <borg.testsuite.archiver.ArchiverTestCase testMethod=test_basic_functionality>

    def test_basic_functionality(self):
        have_root = self.create_test_files()
        self.cmd('init', self.repository_location)
        self.cmd('create', self.repository_location + '::test', 'input')
        self.cmd('create', '--stats', self.repository_location + '::test.2', 'input')
        with changedir('output'):
            self.cmd('extract', self.repository_location + '::test')
        self.assert_equal(len(self.cmd('list', self.repository_location).splitlines()), 2)
        expected =  [
            'input',
            'input/bdev',
            'input/cdev',
            'input/dir2',
            'input/dir2/file2',
            'input/empty',
            'input/fifo1',
            'input/file1',
            'input/flagfile',
            'input/hardlink',
            'input/link1',
        ]
        if not have_root:
            # we could not create these device files without (fake)root
            expected.remove('input/bdev')
            expected.remove('input/cdev')
        if has_lchflags:
            # remove the file we did not backup, so input and output become equal
            expected.remove('input/flagfile') # this file is UF_NODUMP
            os.remove(os.path.join('input', 'flagfile'))
        self.assert_equal(self.cmd('list', '--short', self.repository_location + '::test').splitlines(), expected)
>       self.assert_dirs_equal('input', 'output/input')

py34/lib/python3.4/site-packages/borg/testsuite/archiver.py:227: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
py34/lib/python3.4/site-packages/borg/testsuite/__init__.py:53: in assert_dirs_equal
    self._assert_dirs_equal_cmp(diff)
py34/lib/python3.4/site-packages/borg/testsuite/__init__.py:84: in _assert_dirs_equal_cmp
    self.assert_equal(d1, d2)
E   AssertionError: Lists differ: ['file1', 36333, 1000, 0, 137408, 2, 1442270569924832948, {}] != ['file1', 36333, 1000, 0, 137584, 2, 1442270569924832948, {}]
E   
E   First differing element 4:
E   137408
E   137584
E   
E   - ['file1', 36333, 1000, 0, 137408, 2, 1442270569924832948, {}]
E   ?                               --
E   
E   + ['file1', 36333, 1000, 0, 137584, 2, 1442270569924832948, {}]
E   ?                              ++

The order of items in that list is: filename, st_mode, st_uid, st_gid, st_rdev, st_nlink, st_mtime_ns, xattr_dict.

So, why is st_rdev different here? This difference only happens on openbsd - not on linux, freebsd, darwin. What does st_rdev mean for a regular file (on openbsd, on other systems)?

Reproducing:

  • vagrant up openbsd
  • vagrant ssh openbsd

Then:

cd /vagrant/borg
. borg-env/bin/activate
cd borg
tox
@ThomasWaldmann ThomasWaldmann changed the title strange test fails on openbsd st_rdev test fails on openbsd Sep 15, 2015
@ThomasWaldmann
Copy link
Member Author

This seems to be a test misbehaviour. st_rdev has (AFAIK) not documented meaning except for char or block devices. We backup st_rdev only for block/char devices and we restore st_rdev only for block/char devices. So whatever these files show there for files that are not char/block devices is set by the filesystem itself, so we don't need to compare it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant