iustin / pyxattr

A python module for accessing filesystem Extended Attributes
https://pyxattr.k1024.org/
GNU Lesser General Public License v2.1
31 stars 14 forks source link

Tests should only look at the user namespace #34

Open kloczek opened 2 years ago

kloczek commented 2 years ago

I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

I would be glad to have any hints what could be wrong with all those units failing the same way. Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pyxattr-0.7.2-6.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pyxattr-0.7.2-6.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra tests
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pyxattr-0.7.2
collected 287 items

tests/test_xattr.py ........................FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 50%]
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.........................                      [100%]

================================================================================= FAILURES =================================================================================
_________________________________________________________________ test_mixed_access[get_file_and_symlink] __________________________________________________________________

testdir = './tmpwkifmxad', gen = <function get_file_and_symlink at 0x7f9747b57160>

    @pytest.mark.parametrize(
        "gen", [ get_file_and_symlink, get_file_and_fobject ])
    def test_mixed_access(testdir, gen):
        """test mixed access to file"""
        with gen(testdir) as (a, b):
            # Check empty
>           lists_equal(xattr.list(a), [])

tests/test_xattr.py:239:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

attrs = [b'security.selinux'], value = []

    def lists_equal(attrs, value):
        """Helper to check list equivalence, skipping TEST_IGNORE_XATTRS."""
>       assert ignore(attrs) == value
E       AssertionError: assert [b'security.selinux'] == []
E         Left contains one more item: b'security.selinux'
E         Use -v to get more diff

tests/test_xattr.py:58: AssertionError
_________________________________________________________________ test_mixed_access[get_file_and_fobject] __________________________________________________________________

testdir = './tmptvyh297z', gen = <function get_file_and_fobject at 0x7f9747b57280>

    @pytest.mark.parametrize(
        "gen", [ get_file_and_symlink, get_file_and_fobject ])
    def test_mixed_access(testdir, gen):
        """test mixed access to file"""
        with gen(testdir) as (a, b):
            # Check empty
>           lists_equal(xattr.list(a), [])

tests/test_xattr.py:239:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

[..]

attrs = [b'user.test', b'security.selinux'], value = [b'user.test']

    def lists_equal(attrs, value):
        """Helper to check list equivalence, skipping TEST_IGNORE_XATTRS."""
>       assert ignore(attrs) == value
E       AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
E         Left contains one more item: b'security.selinux'
E         Use -v to get more diff

tests/test_xattr.py:58: AssertionError
______________________________________________________________ test_binary_payload[file via symlink (bytes)] _______________________________________________________________

subject = (b'/home/tkloczko/rpmbuild/BUILD/pyxattr-0.7.2/tmp7bsemk3d/xattr-z6ppkeyc.test.symlink', False)

    def test_binary_payload(subject):
        """test binary values"""
        item = subject[0]
        BINVAL = b"abc\0def"
        xattr.set(item, USER_ATTR, BINVAL)
>       lists_equal(xattr.list(item), [USER_ATTR])

tests/test_xattr.py:433:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

attrs = [b'user.test', b'security.selinux'], value = [b'user.test']

    def lists_equal(attrs, value):
        """Helper to check list equivalence, skipping TEST_IGNORE_XATTRS."""
>       assert ignore(attrs) == value
E       AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
E         Left contains one more item: b'security.selinux'
E         Use -v to get more diff

tests/test_xattr.py:58: AssertionError
_______________________________________________________________ test_binary_payload[file via symlink (path)] _______________________________________________________________

subject = (PurePosixPath('/home/tkloczko/rpmbuild/BUILD/pyxattr-0.7.2/tmp3h1zgd0v/xattr-yf6x74lj.test.symlink'), False)

    def test_binary_payload(subject):
        """test binary values"""
        item = subject[0]
        BINVAL = b"abc\0def"
        xattr.set(item, USER_ATTR, BINVAL)
>       lists_equal(xattr.list(item), [USER_ATTR])

tests/test_xattr.py:433:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

attrs = [b'user.test', b'security.selinux'], value = [b'user.test']

    def lists_equal(attrs, value):
        """Helper to check list equivalence, skipping TEST_IGNORE_XATTRS."""
>       assert ignore(attrs) == value
E       AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
E         Left contains one more item: b'security.selinux'
E         Use -v to get more diff

tests/test_xattr.py:58: AssertionError
========================================================================= short test summary info ==========================================================================
FAILED tests/test_xattr.py::test_mixed_access[get_file_and_symlink] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_mixed_access[get_file_and_fobject] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[file name-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[file name-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[file name (bytes)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[file name (bytes)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[file name (path)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[file name (path)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[file FD-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[file FD-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[file object-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[file object-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[file io stream-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[file io stream-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[directory-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[directory-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[directory (bytes)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[directory (bytes)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[directory (path)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[directory (path)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[file via symlink-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[file via symlink-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[file via symlink (bytes)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[file via symlink (bytes)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[file via symlink (path)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing[file via symlink (path)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[file name-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[file name-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[file name (bytes)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[file name (bytes)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[file name (path)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[file name (path)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[file FD-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[file FD-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[file object-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[file object-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[file io stream-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[file io stream-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[directory-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[directory-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[directory (bytes)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[directory (bytes)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[directory (path)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[directory (path)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[file via symlink-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[file via symlink-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[file via symlink (bytes)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[file via symlink (bytes)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[file via symlink (path)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing[file via symlink (path)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[file name-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[file name-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[file name (bytes)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[file name (bytes)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[file name (path)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[file name (path)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[file FD-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[file FD-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[file object-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[file object-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[file io stream-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[file io stream-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[directory-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[directory-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[directory (bytes)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[directory (bytes)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[directory (path)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[directory (path)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[file via symlink-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[file via symlink-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[file via symlink (bytes)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[file via symlink (bytes)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[file via symlink (path)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[file via symlink (path)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[valid symlink-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[valid symlink-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[valid symlink (bytes)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[valid symlink (bytes)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[dangling symlink-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[dangling symlink-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[dangling symlink (bytes)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing[dangling symlink (bytes)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[file name-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[file name-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[file name (bytes)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[file name (bytes)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[file name (path)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[file name (path)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[file FD-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[file FD-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[file object-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[file object-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[file io stream-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[file io stream-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[directory-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[directory-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[directory (bytes)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[directory (bytes)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[directory (path)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[directory (path)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[file via symlink-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[file via symlink-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[file via symlink (bytes)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[file via symlink (bytes)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[file via symlink (path)-with namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove[file via symlink (path)-no namespace] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing_deprecated[file name] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing_deprecated[file name (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing_deprecated[file name (path)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing_deprecated[file FD] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing_deprecated[file object] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing_deprecated[file io stream] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing_deprecated[directory] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing_deprecated[directory (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing_deprecated[directory (path)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing_deprecated[file via symlink] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing_deprecated[file via symlink (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_replace_on_missing_deprecated[file via symlink (path)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing_deprecated[file name] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing_deprecated[file name (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing_deprecated[file name (path)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing_deprecated[file FD] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing_deprecated[file object] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing_deprecated[file io stream] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing_deprecated[directory] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing_deprecated[directory (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing_deprecated[directory (path)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing_deprecated[file via symlink] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing_deprecated[file via symlink (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_create_on_existing_deprecated[file via symlink (path)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing_deprecated[file name] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing_deprecated[file name (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing_deprecated[file name (path)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing_deprecated[file FD] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing_deprecated[file object] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing_deprecated[file io stream] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing_deprecated[directory] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing_deprecated[directory (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing_deprecated[directory (path)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing_deprecated[file via symlink] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing_deprecated[file via symlink (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing_deprecated[file via symlink (path)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing_deprecated[valid symlink] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing_deprecated[valid symlink (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing_deprecated[dangling symlink] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_remove_on_missing_deprecated[dangling symlink (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove_deprecated[file name] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove_deprecated[file name (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove_deprecated[file name (path)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove_deprecated[file FD] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove_deprecated[file object] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove_deprecated[file io stream] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove_deprecated[directory] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove_deprecated[directory (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove_deprecated[directory (path)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove_deprecated[file via symlink] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove_deprecated[file via symlink (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_set_get_remove_deprecated[file via symlink (path)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_many_ops[file name] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops[file name (bytes)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops[file name (path)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops[file FD] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops[file object] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops[file io stream] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops[directory] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops[directory (bytes)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops[directory (path)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops[file via symlink] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops[file via symlink (bytes)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops[file via symlink (path)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops_deprecated[file name] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops_deprecated[file name (bytes)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops_deprecated[file name (path)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops_deprecated[file FD] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops_deprecated[file object] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops_deprecated[file io stream] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops_deprecated[directory] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops_deprecated[directory (bytes)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops_deprecated[directory (path)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops_deprecated[file via symlink] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops_deprecated[file via symlink (bytes)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_many_ops_deprecated[file via symlink (path)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_no_attributes_deprecated[file name] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes_deprecated[file name (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes_deprecated[file name (path)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes_deprecated[file FD] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes_deprecated[file object] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes_deprecated[file io stream] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes_deprecated[directory] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes_deprecated[directory (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes_deprecated[directory (path)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes_deprecated[file via symlink] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes_deprecated[file via symlink (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes_deprecated[file via symlink (path)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes_deprecated[valid symlink] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes_deprecated[valid symlink (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes_deprecated[dangling symlink] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes_deprecated[dangling symlink (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes[file name] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes[file name (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes[file name (path)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes[file FD] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes[file object] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes[file io stream] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes[directory] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes[directory (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes[directory (path)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes[file via symlink] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes[file via symlink (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes[file via symlink (path)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes[valid symlink] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes[valid symlink (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes[dangling symlink] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_no_attributes[dangling symlink (bytes)] - AssertionError: assert [b'security.selinux'] == []
FAILED tests/test_xattr.py::test_binary_payload_deprecated[file name] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload_deprecated[file name (bytes)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload_deprecated[file name (path)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload_deprecated[file FD] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload_deprecated[file object] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload_deprecated[file io stream] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload_deprecated[directory] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload_deprecated[directory (bytes)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload_deprecated[directory (path)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload_deprecated[file via symlink] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload_deprecated[file via symlink (bytes)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload_deprecated[file via symlink (path)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload[file name] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload[file name (bytes)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload[file name (path)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload[file FD] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload[file object] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload[file io stream] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload[directory] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload[directory (bytes)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload[directory (path)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload[file via symlink] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload[file via symlink (bytes)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
FAILED tests/test_xattr.py::test_binary_payload[file via symlink (path)] - AssertionError: assert [b'user.test'...rity.selinux'] == [b'user.test']
====================================================================== 238 failed, 49 passed in 4.35s ======================================================================
iustin commented 2 years ago

It looks like you're running this on a file system with SELinux attributes enabled, hence all files contain extra xattrs that the tests don't know how to ignore.

I'll take a look and hope to fix it, but it'll take a while more.

kloczek commented 2 years ago

It looks like you're running this on a file system with SELinux attributes enable

Yep .. that is true. Thank you 😄

iustin commented 2 years ago

Just checked, and the tests support ignoring a custom list of attributes. Just make sure to run the tests with this env. var:

export TEST_IGNORE_XATTRS=security.selinux

And that should make them ignore this system-generated attribute. See line 22 in the test file.

Maybe it would be a good idea to ignore all system-prefixed attributes, not sure.

kloczek commented 2 years ago

So those test units are broken? 🤔

iustin commented 2 years ago

The unittest are running under the assumption that nothing else touches the xattrs of the temporary files they create. Some filesystems, or some systems, do that - selinux and nfs4 are known culprits. But it's not possible for me to know all types of system-specific xattrs that exist, so the env var is provided as a way to ignore local system settings.

So no, they're not broken. They might be improved, but it's not clear to me how to that and ensure they work/test well on all systems.

kloczek commented 2 years ago

So where is the bug? 🤔

iustin commented 2 years ago

There is no bug. You just need to tell the tests how to properly run on your system, which has custom attrs by default.

kloczek commented 2 years ago

What you mean "which has custom attrs by default"?

iustin commented 2 years ago

There are multiple namespaces for xattrs, and depending on your system, new files might automatically get by default xattrs in those non-user namespaces. The tests don't deal with this situation automatically.

After thinking some more, I think I'll change the tests to only look at user attributes. Those are unlikely to be touched by anything during tests (but not impossible).

kloczek commented 2 years ago

There are multiple namespaces for xattrs, and depending on your system, new files might automatically get by default xattrs in those non-user namespaces

How can I check which one namespace is used when test suite is executed?