~ubuntu-branches/debian/sid/obnam/sid

« back to all changes in this revision

Viewing changes to obnamlib/vfs_local_tests.py

  • Committer: Package Import Robot
  • Author(s): Lars Wirzenius
  • Date: 2015-07-01 18:14:49 UTC
  • Revision ID: package-import@ubuntu.com-20150701181449-taxcvqg9cviw2cxo
Tags: 1.10-1
* New upstream version.
  * Fix "restore to /tmp messes up directory perms" by preventing
    restores to a non-empty directory. (Closes: #760492)
* Add build-dependency on git.
* Drop build-dependency on texlive and building of PDF form of manual.
  Texlive is an insanely large build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008-2014  Lars Wirzenius <liw@liw.fi>
 
1
# Copyright (C) 2008-2015  Lars Wirzenius <liw@liw.fi>
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
14
14
# with this program; if not, write to the Free Software Foundation, Inc.,
15
15
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16
16
 
17
 
import platform
18
 
import errno
19
17
import os
20
18
import shutil
21
19
import tempfile
48
46
        self.assertEqual(self.fs.get_username(0), 'root')
49
47
 
50
48
    def test_get_groupname_returns_root_for_zero(self):
51
 
        root = 'wheel' if platform.system() == 'FreeBSD' else 'root'
52
 
        self.assertEqual(self.fs.get_groupname(0), root)
 
49
        # Some Unix systems have a wheel group instead of a root
 
50
        # group. We're fine with either.
 
51
        self.assertTrue(self.fs.get_groupname(0) in ['root', 'wheel'])
53
52
 
54
53
 
55
54
class XAttrTests(unittest.TestCase):
70
69
        # attribute with the command line tool.
71
70
 
72
71
        try:
73
 
            exit, out, err = cliapp.runcmd_unchecked(
 
72
            exitcode, out, err = cliapp.runcmd_unchecked(
74
73
                ['setfattr', '-n', 'user.foo', 'bar', self.other])
75
74
        except OSError:
76
75
            # Either xattr aren't supported, or setfattr isn't
77
76
            # installed and we can't test.
78
77
            return False
79
 
        return exit == 0
 
78
        return exitcode == 0
80
79
 
81
80
    def test_empty_list(self):
82
81
        '''A new file has no extended attributes.'''