Blame SOURCES/0014-test-functions-add-macro-DBUS_INTROSPECT.patch

8a3219
From aba9e384a4de8785717e569905a4459a2fc15b4d Mon Sep 17 00:00:00 2001
8a3219
From: Eric Garver <eric@garver.life>
8a3219
Date: Fri, 5 Jul 2019 17:13:20 -0400
8a3219
Subject: [PATCH 14/20] test: functions: add macro DBUS_INTROSPECT
8a3219
8a3219
We'll use this to introspect and verify the API.
8a3219
8a3219
(cherry picked from commit 5f32c24dec88c60e4f43d27ea56ea208016c339b)
8a3219
---
8a3219
 src/tests/functions.at | 10 ++++++++++
8a3219
 1 file changed, 10 insertions(+)
8a3219
8a3219
diff --git a/src/tests/functions.at b/src/tests/functions.at
8a3219
index 8aeaf158a066..3771bb8bd5a7 100644
8a3219
--- a/src/tests/functions.at
8a3219
+++ b/src/tests/functions.at
8a3219
@@ -356,6 +356,16 @@ m4_define([NFT_LIST_SET], [
8a3219
     ])
8a3219
 ])
8a3219
 
8a3219
+m4_define([DBUS_INTROSPECT], [
8a3219
+    AT_SKIP_IF([! NS_CMD([which gdbus >/dev/null 2>&1])])
8a3219
+    AT_SKIP_IF([! NS_CMD([which xmllint >/dev/null 2>&1])])
8a3219
+    NS_CHECK([PIPESTATUS0([gdbus introspect --xml --system --dest=org.fedoraproject.FirewallD1 dnl
8a3219
+                           m4_ifblank([$1], [--object-path /org/fedoraproject/FirewallD1],
8a3219
+                                            [--object-path /org/fedoraproject/FirewallD1/$1])], dnl
8a3219
+                          [m4_ifnblank([$2], [xmllint --xpath '$2' - |]) TRIM_WHITESPACE])],
8a3219
+             [$3], [m4_strip([$4])], [m4_strip([$5])], [$6], [$7])
8a3219
+])
8a3219
+
8a3219
 m4_define([DBUS_CHECK_NORMALIZE], [dnl
8a3219
     [sed -e 's/^({//' -e 's/},)$//' -e 's/>,/>\n/g'] | dnl truncate dictionary output
8a3219
     TRIM_WHITESPACE | dnl
8a3219
-- 
8a3219
2.20.1
8a3219