This is a straightforward issue. The tests for pyxattr assume that newly created temporary files have no extended attributes. Therefore most of them fail if security.selinux is set on these test files. See a somewhat ugly workaround in the pull request I sent upstream: https://github.com/iustin/pyxattr/pull/5 I don't find this very concerning, because it only affects the tests and not the package itself. But if someone is feeling motivated, they could patch with either the workaround I linked to above, or something more elegant.
Update: I made my proposed change nicer: https://github.com/iustin/pyxattr/pull/5 With this change, I could get the tests to pass with: TEST_IGNORE_XATTRS="security.selinux"
The workaround is available in version 0.5.3, but the above TEST_IGNORE_XATTRS line needs to be added to the ebuild (perhaps conditionally just for selling systems).
*pyxattr-0.5.3 (03 Jun 2014) 03 Jun 2014; Ian Delaney <idella4@gentoo.org> +pyxattr-0.5.3.ebuild: bump; drop py2.6 pypy2_0 add py3.4 support, add IUSE doc, dep, doc build
This still requires an additional ebuild change for 0.5.3, because the environment variable TEST_IGNORE_XATTRS must be set during the test phase to a comma-separated list of attributes that may be present on new files. That is, for SELinux you need at least: TEST_IGNORE_XATTRS="security.selinux" Doing this for everyone (including non-SELinux systems) should be harmless.
Created attachment 435128 [details, diff] Handle TEST_DIR and TEST_IGNORE_XATTRS In case anyone stumbles across this bug report, here is a workaround: TEST_DIR="/path/to/fs/with/xattr/support" \ TEST_IGNORE_XATTRS="security.selinux" emerge pyxattr So, now for the original problem. Here is a patch (also attached) doing four things: * Fixing the typo for the TEST_DIR (note the underscore) variable. * Respect a user set TEST_DIR (in case /var/tmp is on a file system not supporting extended attributes) * Exporting TEST_IGNORE_XATTRS="security.selinux", so test pass on SELinux systems. The user's choice is honoured here, too. * Inform the user about all that. --- a/dev-python/pyxattr/pyxattr-0.5.5.ebuild +++ b/dev-python/pyxattr/pyxattr-0.5.5.ebuild @@ -39,10 +39,25 @@ src_test() { # Perform the tests in /var/tmp; that location is more likely # to have xattr support than /tmp which is often tmpfs. - export TESTDIR=/var/tmp + # However, respect the user choice for TEST_DIR. (Bug #503946) + if [ -z "${TEST_DIR}" ]; then + export TEST_DIR=/var/tmp + fi + if [ -z "${TEST_IGNORE_XATTRS}" ]; then + export TEST_IGNORE_XATTRS="security.selinux" + fi einfo 'Please note that the tests fail if xattrs are not supported' einfo 'by the filesystem used for /var/tmp.' + einfo 'To use a different location than /var/tmp set the environment' + einfo 'variable TEST_DIR to that location, e.g.' + einfo + einfo ' $ export TEST_DIR="/my/test/place"' + einfo + einfo 'For even more control TEST_IGNORE_XATTRS (Bug #503946) can also' + einfo 'be set. Refer to the documentation in the source code for further' + einfo 'information.' + distutils-r1_src_test }
Thanks for your diff. I'm going to rewrite it a bit, split into separate commits and finally fix this bug.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1cfb464fb47e64a219859329ed65692293cc7197 commit 1cfb464fb47e64a219859329ed65692293cc7197 Author: Michał Górny <mgorny@gentoo.org> AuthorDate: 2018-04-24 16:02:41 +0000 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: 2018-04-24 16:08:58 +0000 dev-python/pyxattr: Allow overriding TEST_* Closes: https://bugs.gentoo.org/503946 dev-python/pyxattr/pyxattr-0.6.0-r1.ebuild | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d7c2a7c30cca0da599fc17eb78653dabc94b5732 commit d7c2a7c30cca0da599fc17eb78653dabc94b5732 Author: Michał Górny <mgorny@gentoo.org> AuthorDate: 2018-04-24 15:59:56 +0000 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: 2018-04-24 16:08:58 +0000 dev-python/pyxattr: Ignore selinux xattrs by default Bug: https://bugs.gentoo.org/503946 dev-python/pyxattr/pyxattr-0.6.0-r1.ebuild | 2 ++ 1 file changed, 2 insertions(+) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8dbfb45817bd641214cd98bf29c8f076d4d71b07 commit 8dbfb45817bd641214cd98bf29c8f076d4d71b07 Author: Michał Górny <mgorny@gentoo.org> AuthorDate: 2018-04-24 15:53:28 +0000 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: 2018-04-24 16:08:58 +0000 dev-python/pyxattr: Fix TEST_DIR variable name Bug: https://bugs.gentoo.org/503946 dev-python/pyxattr/pyxattr-0.6.0-r1.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)}
Hi Michał Thanks for taking care of this issue!