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

Tests should only look at the user namespace #34

Open
kloczek opened this issue May 3, 2022 · 10 comments
Open

Tests should only look at the user namespace #34

kloczek opened this issue May 3, 2022 · 10 comments

Comments

@kloczek
Copy link

kloczek commented May 3, 2022

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.

  • python3 -sBm build -w --no-isolation
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

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
Copy link
Owner

iustin commented May 25, 2022

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
Copy link
Author

kloczek commented May 25, 2022

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

Yep .. that is true.
Thank you 😄

@iustin
Copy link
Owner

iustin commented Oct 8, 2022

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.

@iustin iustin closed this as completed Oct 8, 2022
@kloczek
Copy link
Author

kloczek commented Oct 8, 2022

So those test units are broken? 🤔

@iustin
Copy link
Owner

iustin commented Oct 8, 2022

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
Copy link
Author

kloczek commented Oct 8, 2022

So where is the bug? 🤔

@iustin
Copy link
Owner

iustin commented Oct 8, 2022

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
Copy link
Author

kloczek commented Oct 9, 2022

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

@iustin
Copy link
Owner

iustin commented Oct 9, 2022

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).

@iustin iustin changed the title 0.7.2: pytest is failing Tests should only look at the user namespace Oct 9, 2022
@iustin iustin reopened this Oct 9, 2022
@kloczek
Copy link
Author

kloczek commented Oct 9, 2022

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?

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

No branches or pull requests

2 participants