Skip to content

Commit e547864

Browse files
committed
tests/common: Fix D-Bus mock initialization / shutdown
Keep the stdio attached to the shell and reset the system bus environment variable.
1 parent 94cd797 commit e547864

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/test_common.sh.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ init_dbus_mock() {
368368
require_python_module "dbusmock" || return 255
369369
require "gdbus" || return 255
370370
printf "%s\n" "Initializing D-Bus mock from template: $1.py"
371-
python3 -m dbusmock --template "${srcdir}/$1.py" & disown
371+
python3 -m dbusmock --template "${srcdir}/$1.py" &
372372
# We have to replace system bus address because mock D-Bus
373373
# endpoint is created inside the user session
374374
export DBUS_SYSTEM_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS
@@ -380,6 +380,7 @@ clean_dbus_mock() {
380380
require "gdbus" || return 255
381381
printf "%s\n" "Shutting down D-Bus mock: $1"
382382
gdbus call --session -d "$1" -o / -m "$1.Exit" >/dev/null 2>&1 || true
383+
export DBUS_SYSTEM_BUS_ADDRESS=
383384
}
384385

385386
export -f assert_exists

0 commit comments

Comments
 (0)