libink: declare signals in introspection XML

All three org.finit signals were invisible to generated proxies, and
org.freedesktop.DBus was missing from the standard interfaces even
though Hello, AddMatch, and RemoveMatch are answered.

Add a link_signal_t table to the vtable, emitted like methods and
properties, declare the Manager1 and Cond1 signals, and complete the
static XML with PropertiesChanged and org.freedesktop.DBus.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2026-08-16 22:03:39 +02:00
parent 9d4cc8e933
commit b743d15e35
5 changed files with 92 additions and 1 deletions
+33
View File
@@ -29,3 +29,36 @@ case "$xml" in
fail "per-character <arg> fragment leaked" ;;
*) assert "no bracket/array fragments" 0 -eq 0 ;;
esac
# ---------- <signal> declarations ----------
say "Cond1 declares the ConditionChanged signal"
case "$xml" in
*'<signal name="ConditionChanged">'*) assert "ConditionChanged declared" 0 -eq 0 ;;
*) fail "ConditionChanged missing from Cond1 XML" ;;
esac
say "Manager1 declares ServiceStateChanged and RunlevelChanged"
mgr=$(texec "$CLIENT" introspect "$BUS" /org/finit/manager)
case "$mgr" in
*'<signal name="ServiceStateChanged">'*'<signal name="RunlevelChanged">'*)
assert "Manager1 signals declared" 0 -eq 0 ;;
*) fail "Manager1 signal declarations missing" ;;
esac
say "Properties declares PropertiesChanged, org.freedesktop.DBus is present"
case "$mgr" in
*'<signal name="PropertiesChanged">'*) assert "PropertiesChanged declared" 0 -eq 0 ;;
*) fail "PropertiesChanged missing from Properties XML" ;;
esac
# Hello/AddMatch/RemoveMatch are answered on the canonical object
# only, so they must be declared there and nowhere else.
drv=$(texec "$CLIENT" introspect "$BUS" /org/freedesktop/DBus)
case "$drv" in
*'<interface name="org.freedesktop.DBus">'*) assert "org.freedesktop.DBus declared on canonical object" 0 -eq 0 ;;
*) fail "org.freedesktop.DBus missing from /org/freedesktop/DBus" ;;
esac
case "$mgr" in
*'<interface name="org.freedesktop.DBus">'*) fail "org.freedesktop.DBus leaked onto /org/finit/manager" ;;
*) assert "org.freedesktop.DBus not advertised off-path" 0 -eq 0 ;;
esac