tests: force dbus-daemon to generate an abstract socket

dbus 1.14.4 changed the behavior of unix:tmpdir to be equivalent to
unix:dir, which cases dbus-daemon to generate path based sockets,
instead of the previous abstract sockets. [1]
In this change we force dbus-daemon to generate an abstract socket by
specifying the abstract socket address in the command.

[1] https://gitlab.freedesktop.org/dbus/dbus/-/blob/dbus-1.14/NEWS#L64

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
This commit is contained in:
Georgia Garcia 2023-03-27 16:11:36 -03:00
parent bba1a023bf
commit 53d4e341e1

View file

@ -128,7 +128,8 @@ start_dbus_daemon()
return 1 return 1
fi fi
out=$(dbus-daemon --fork --print-pid --print-address --config-file=dbus.conf) bus_addr=$(mktemp --dry-run /tmp/dbus-XXXXXX)
out=$(dbus-daemon --fork --print-pid --print-address --address="unix:abstract=$bus_addr" --config-file=dbus.conf)
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
echo "Failed to start DBus daemon" echo "Failed to start DBus daemon"