From ce428c1f60b6ec2a831b817c909819482e56bcb8 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 17 Jun 2022 14:15:35 +0100 Subject: [PATCH] test-basic-c: Don't assert that extended attributes are available Not all filesystems support extended attributes. This test uses /var/tmp to try to get an extended-attributes-capable filesystem, but that might not succeed. Signed-off-by: Simon McVittie --- tests/test-basic-c.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/test-basic-c.c b/tests/test-basic-c.c index 1886feb2..fc995298 100644 --- a/tests/test-basic-c.c +++ b/tests/test-basic-c.c @@ -514,8 +514,15 @@ test_read_xattrs (void) g_assert_no_error (local_error); int r = fsetxattr (tmpd.fd, "user.ostreetesting", value, sizeof (value), 0); - g_assert_cmpint (r, ==, 0); - + + if (r != 0) + { + g_autofree gchar *message = g_strdup_printf ("Unable to set extended attributes in /var/tmp: %s", + g_strerror (errno)); + g_test_skip (message); + return; + } + g_autoptr(GVariant) new_xattrs = ostree_fs_get_all_xattrs (tmpd.fd, NULL, error); g_assert_no_error (local_error);