From 5cf08a9a1041a9dc9975371fb62f8f22c3be76c4 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 3 Apr 2024 21:25:04 +0200
Subject: [PATCH 2/3] tests: skip gio tests which fails with missing machine-id

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
---
 gio/tests/meson.build | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gio/tests/meson.build b/gio/tests/meson.build
index f04ff43ff..71ec09750 100644
--- a/gio/tests/meson.build
+++ b/gio/tests/meson.build
@@ -46,6 +46,8 @@ if glib_build_shared
   subdir('modules')
 endif
 
+have_machine_id = import('fs').is_file('/etc/machine-id')
+
 #  Test programs buildable on all platforms
 gio_tests = {
   'application-command-line': {},
@@ -98,7 +100,7 @@ gio_tests = {
     'install_rpath' : installed_tests_execdir,
     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/3148
-    'can_fail' : host_system in ['darwin', 'windows', 'gnu'],
+    'can_fail' : host_system in ['darwin', 'windows', 'gnu'] or not have_machine_id,
   },
   'inet-address' : {},
   'io-stream' : {},
@@ -147,7 +149,7 @@ gio_tests = {
     'extra_programs': host_system != 'windows' ? ['dbus-launch'] : [],
     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/1392
     # FIXME: https://gitlab.gnome.org/GNOME/glib/-/issues/3148
-    'can_fail' : host_system in ['darwin', 'gnu'],
+    'can_fail' : host_system in ['darwin', 'gnu'] or not have_machine_id,
   },
   'win32-appinfo' : {},
 }
