Add patch to skip a test-case if /var/tmp doesn't support xattrs
authorSimon McVittie <smcv@debian.org>
Fri, 17 Jun 2022 13:16:03 +0000 (14:16 +0100)
committerSimon McVittie <smcv@debian.org>
Fri, 17 Jun 2022 13:30:33 +0000 (14:30 +0100)
debian/patches/series
debian/patches/test-basic-c-Don-t-assert-that-extended-attributes-are-av.patch [new file with mode: 0644]

index b73e566a722cdb595a2da78c1c1ef5f43703efb2..dd253aafae78f4c8d0f232b971e42b0715332180 100644 (file)
@@ -1 +1,2 @@
+test-basic-c-Don-t-assert-that-extended-attributes-are-av.patch
 debian/Skip-test-pull-repeated-during-CI.patch
diff --git a/debian/patches/test-basic-c-Don-t-assert-that-extended-attributes-are-av.patch b/debian/patches/test-basic-c-Don-t-assert-that-extended-attributes-are-av.patch
new file mode 100644 (file)
index 0000000..919597b
--- /dev/null
@@ -0,0 +1,37 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Fri, 17 Jun 2022 14:15:35 +0100
+Subject: 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 <smcv@debian.org>
+Forwarded: https://github.com/ostreedev/ostree/pull/2652
+---
+ tests/test-basic-c.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/tests/test-basic-c.c b/tests/test-basic-c.c
+index 1886feb..abaeca5 100644
+--- a/tests/test-basic-c.c
++++ b/tests/test-basic-c.c
+@@ -514,8 +514,16 @@ 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)
++      {
++        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);
+