Iustin Pop [Sat, 5 Jun 2021 02:53:43 +0000 (04:53 +0200)]
Skip user symlink test on MacOSX
Apparently MacOS doesn't have the same limitation (feature?) as Linux
of preventing regular users from settings xattrs on symlinks, so let's
skip this test on it (MacOS).
Iustin Pop [Sat, 5 Jun 2021 02:20:15 +0000 (04:20 +0200)]
Stop uploading to coveralls
This allows significant cleanup as we don't need anymore a post-job
and we can drop lcov installation/processing. Codecov is switched back
in gcov mode.
Iustin Pop [Sat, 5 Jun 2021 01:46:48 +0000 (03:46 +0200)]
Remove auto-detection of optimal buffer size
Since we don't pass zero anymore, this code is never called. Replace
it with 'zero means hardcoded initial value', since that hardcoded
value is what we were already passing, and change all the callers to
pass in zero (as 'auto-compute' again) instead, for simplicity.
Iustin Pop [Sun, 6 Dec 2020 14:07:35 +0000 (15:07 +0100)]
Store doc/readme and doc/news in the git repo
… instead of rebuilding them every time. This is in order to fix the
readthedocs "build", since it only builds docs (via sphinx) but
doesn't run the actual build.
Iustin Pop [Sun, 29 Nov 2020 19:50:06 +0000 (20:50 +0100)]
Remove compatibility with old recommonmark versions
It's hard trying to keep compatibility with both very old (<1.8),
old (1.8) and modern (Sphinx), while also supporting old recommonmark;
recommonmark 0.5 was released in January 2019.
So let's drop the old support and just keep support for Sphinx 1.8 and
3.0+, and more modern recommonmark.
Iustin Pop [Tue, 26 Nov 2019 02:24:42 +0000 (03:24 +0100)]
Switch namespace_none test to check all calls
Instead of all input parameter types for one call. This is better
since more calls are checked, and the parameter type checking is not
the goal of this test.
Iustin Pop [Mon, 25 Nov 2019 02:07:51 +0000 (03:07 +0100)]
tests: stop trying to set user attributes on symlinks
According to xattr(7), by design setting/modifying user attributes on
symlinks is not allowed, due to the way access control works, so stop
trying to test it.
Iustin Pop [Sat, 2 Mar 2019 20:14:41 +0000 (21:14 +0100)]
Travis: remove "sudo:false"
Per the deprecation of container-based
builds (https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration),
remove the sudo:false setting.
Iustin Pop [Tue, 24 Jul 2018 21:39:00 +0000 (23:39 +0200)]
Travis: remove python 3.2 from build list
It seems the setuptools libraries that are installed in the travis
environments don't support anymore 3.2, which causes the builds to be
wrongly marked as failed.
Iustin Pop [Tue, 24 Jul 2018 21:20:53 +0000 (23:20 +0200)]
Tests: fix symlink testing
On Linux, non-root users are not allowed to set extended attributes,
so normal testing has hidden this. A fix to the Mac OS support
proposed in #14 uncovered this problem, which led to investigation and
this fix.
Manual testing on Linux with root and namespace=trusted now passes the
tests.
Iustin Pop [Tue, 24 Jul 2018 21:14:37 +0000 (23:14 +0200)]
Tests: introduce an alias for NS_USER
Using NS_USER directly makes it hard to change it for a one-off manual
test, so let's virtualise it, and additionally allow overriding from
the command line.
xwhuang [Fri, 9 Mar 2018 01:56:16 +0000 (09:56 +0800)]
Release GIL when do I/O operations
Release GIL in _list_obj, _get_obj, _set_obj, and _remove_obj. These
functions do I/O operations which take long time. We should release
GIL to allow other threads work.
Iustin Pop [Mon, 14 Nov 2016 21:02:25 +0000 (22:02 +0100)]
Expand the testing of invalid arguments
This is not significant advantage, but it does increase coverage. And
any coverage (even if not testing the logic too much) is better than
no coverage.
Iustin Pop [Tue, 25 Oct 2016 23:27:54 +0000 (01:27 +0200)]
Add a makefile coverage target
And expand a tiny bit the test suite to exercise one more error
path. Current coverage is not bad, ~87% lines coverage. For some
reason, no branch coverage is available :/
Iustin Pop [Tue, 25 Oct 2016 22:34:07 +0000 (00:34 +0200)]
Rework getting and listing attributes
Currently, getting and listing attributes is inconsistent in how it
deals with allocating memory for the data returned by the syscall:
- in most cases, we ask the kernel for the value, allocate memory,
then retrieve the value; if the value changed (increased) in the
meantime, this will lead to what should be preventable failures
- in the single case of getall, there is a loop for getting the
individual values, but not for initially get the list of values
Hence the bug report #12. This rather large change refactors a lot of
the code:
- doing a get/list is abstracted away into a helper function that
always does retries until we can read the value or fail with a
different error than ERANGE; this helper deal with all allocations
and resize operations.
- this means most of the single get/list operations are heavily
simplified
- and also means that we can always start optimistically with an
initial buffer size (currently set to 1K), instead of asking the
kernel first: this saves one out of two syscalls in the case the
value will indeed be smaller, but adds one extra syscall (the failed
initial read) in the case it's not.
The optimisation is a double-edged sword: for small attributes, it
will be a win (e.g. the test suite is ~5% faster now), but for large
attribute/lists, it will be potentially slower (50% more
syscalls). Not sure how to nicely deal with this; it would be good to
have a keyword argument maybe? Or build flag? Left for future
enhancements.
Iustin Pop [Sun, 23 Oct 2016 10:49:42 +0000 (12:49 +0200)]
Initialise target_t members on error paths
This is a no-op from the point of view of the actual code flow, but
not doing so can trigger false positives in some versions of GCC (4.9
from Jessie) at high optimisation levels (-O3). For an interesting
discussion of why this happens at `-O3` vs. at `-O2`, see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165.
Iustin Pop [Mon, 2 May 2016 20:53:00 +0000 (22:53 +0200)]
Revert "Add build status badge to README"
This reverts commit de9bc00d145874b5a7a63ef382de215b735e8961. First,
it was markdown and README is rst, but that's not the point: sphinx
wants to warn about 'non-local image in URI', and the silencing of
this is only present in 1.4 and later, so for now just revert.
Iustin Pop [Sun, 1 May 2016 02:59:51 +0000 (04:59 +0200)]
Mark OSX build non-experimental
Also override Python list, since we only care about system python (OSX
doesn't support yet multiple Python versions), and the current state
shows a strange build summary (one build with N python versions).
Iustin Pop [Wed, 12 Aug 2009 19:58:36 +0000 (21:58 +0200)]
Fix building on systems which don't have ENODATA
This patch (a modified form of the original patch from Cyril Brulebois
<kibi@debian.org>) fixes building on systems which don't have ENODATA
(e.g. GNU/kFreeBSD).
Iustin Pop [Fri, 1 May 2015 23:25:51 +0000 (01:25 +0200)]
Fix potential name truncation in merge_ns()
It seems I misread the snprintf man page: a return value of exactly
the buffer size means truncation has occurred, so we need to fix the
operator (`>` → `≥`).
Additionally, improve slightly the error message raised in such a
case; this shouldn't ever happen.