Blob Blame History Raw
From aba9e384a4de8785717e569905a4459a2fc15b4d Mon Sep 17 00:00:00 2001
From: Eric Garver <eric@garver.life>
Date: Fri, 5 Jul 2019 17:13:20 -0400
Subject: [PATCH 14/20] test: functions: add macro DBUS_INTROSPECT

We'll use this to introspect and verify the API.

(cherry picked from commit 5f32c24dec88c60e4f43d27ea56ea208016c339b)
---
 src/tests/functions.at | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/tests/functions.at b/src/tests/functions.at
index 8aeaf158a066..3771bb8bd5a7 100644
--- a/src/tests/functions.at
+++ b/src/tests/functions.at
@@ -356,6 +356,16 @@ m4_define([NFT_LIST_SET], [
     ])
 ])
 
+m4_define([DBUS_INTROSPECT], [
+    AT_SKIP_IF([! NS_CMD([which gdbus >/dev/null 2>&1])])
+    AT_SKIP_IF([! NS_CMD([which xmllint >/dev/null 2>&1])])
+    NS_CHECK([PIPESTATUS0([gdbus introspect --xml --system --dest=org.fedoraproject.FirewallD1 dnl
+                           m4_ifblank([$1], [--object-path /org/fedoraproject/FirewallD1],
+                                            [--object-path /org/fedoraproject/FirewallD1/$1])], dnl
+                          [m4_ifnblank([$2], [xmllint --xpath '$2' - |]) TRIM_WHITESPACE])],
+             [$3], [m4_strip([$4])], [m4_strip([$5])], [$6], [$7])
+])
+
 m4_define([DBUS_CHECK_NORMALIZE], [dnl
     [sed -e 's/^({//' -e 's/},)$//' -e 's/>,/>\n/g'] | dnl truncate dictionary output
     TRIM_WHITESPACE | dnl
-- 
2.20.1