summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2017-04-19 17:47:15 -0400
committerColin Walters <walters@verbum.org>2017-04-21 10:17:02 -0400
commit74383ba40529ef05346f617c846b55a73da1810c (patch)
treee77e5df968ff42a419a808676119b15d94586576
parent2b82858169186d2758c5fe60ad1099eab7f46a25 (diff)
downloadlibglnx-74383ba40529ef05346f617c846b55a73da1810c.tar.gz
tests/xattrs: Skip on filesystems with no user xattr support
Like tmpfs. See: https://github.com/flatpak/flatpak/issues/686
-rw-r--r--tests/test-libglnx-xattrs.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test-libglnx-xattrs.c b/tests/test-libglnx-xattrs.c
index 0b21133..b6f0ac6 100644
--- a/tests/test-libglnx-xattrs.c
+++ b/tests/test-libglnx-xattrs.c
@@ -244,6 +244,21 @@ test_xattr_races (void)
if (!glnx_opendirat (AT_FDCWD, tmpdir, TRUE, &dfd, error))
goto out;
+ /* Support people building/testing on tmpfs https://github.com/flatpak/flatpak/issues/686 */
+ if (fsetxattr (dfd, "user.test", "novalue", strlen ("novalue"), 0) < 0)
+ {
+ if (errno == EOPNOTSUPP)
+ {
+ g_test_skip ("no xattr support");
+ return;
+ }
+ else
+ {
+ glnx_set_error_from_errno (error);
+ goto out;
+ }
+ }
+
for (guint i = 0; i < nprocs; i++)
{
struct XattrWorker *worker = &wdata[i];