Open kloczek opened 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.
It looks like you're running this on a file system with SELinux attributes enable
Yep .. that is true. Thank you 😄
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.
So those test units are broken? 🤔
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.
So where is the bug? 🤔
There is no bug. You just need to tell the tests how to properly run on your system, which has custom attrs by default.
What you mean "which has custom attrs by default"?
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).
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?
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
build
with--no-isolation
I'm using during all processes only locally installed modulesI would be glad to have any hints what could be wrong with all those units failing the same way. Here is pytest output: