spiegel-keyman/linux/keyman-config/tests
Eberhard Beilharz b7d5e89577
fix(linux): fix installing keyboard in shared area
Installing into the shared area (`/usr/local/share`) requires `root`
permissions, so in order to install into the shared area the user has
to call `km-package-install` with `sudo`. But we also want to add the
keyboard to the user's list of available keyboards so that he can
switch to it. That needs to be done in the user context. However,
when `sudo` ran the command in the user context, the environment
variables to connect to the user's session dbus were not set.

This change fixes this by passing `DBUS_SESSION_BUS_ADDRESS` along
with the `sudo -u <user>` call. Since `root` doesn't have this variable
set (or at least not pointing to the user's dbus), we construct the
dbus address based on the user's uid.

On newer Ubuntu versions (>=25.04) we also have to set `XDG_RUNTIME_DIR`,
at least when running the autopkgtests.

Fixes: #14911
2025-10-14 17:54:36 +02:00
..
bcp47tag_tests.py chore(common): allow to run tests in virtual environment 2025-04-29 19:20:49 +02:00
canonical_language_code_utils_tests.py fix(linux): normalize language tags from keyboard 2025-08-18 19:49:38 +02:00
custom_keyboards_tests.py chore(common): allow to run tests in virtual environment 2025-04-29 19:20:49 +02:00
dbus_util_tests.py chore(common): allow to run tests in virtual environment 2025-04-29 19:20:49 +02:00
dconf_util_tests.py chore(common): allow to run tests in virtual environment 2025-04-29 19:20:49 +02:00
get_kmp_tests.py chore(common): allow to run tests in virtual environment 2025-04-29 19:20:49 +02:00
gnome_keyboards_util_tests.py fix(linux): don't crash on invalid languages in keyboard 2025-09-15 16:37:22 +02:00
gsettings_tests.py chore(common): allow to run tests in virtual environment 2025-04-29 19:20:49 +02:00
handle_install_tests.py chore(common): allow to run tests in virtual environment 2025-04-29 19:20:49 +02:00
ibus_util_tests.py chore(common): allow to run tests in virtual environment 2025-04-29 19:20:49 +02:00
install_kmp_tests.py fix(linux): normalize language tags from keyboard 2025-08-18 19:49:38 +02:00
kvk2ldml_tests.py fix(linux): don't crash if kmp.json is missing keyboards section 2025-09-08 18:06:36 +02:00
lang_tags_map_tests.py chore(common): allow to run tests in virtual environment 2025-04-29 19:20:49 +02:00
package_install_completion_tests.py chore(common): allow to run tests in virtual environment 2025-04-29 19:20:49 +02:00
python.env chore(linux): Add some unit tests for keyman_config 2020-06-17 09:19:19 +02:00
uninstall_kmp_tests.py fix(linux): fix installing keyboard in shared area 2025-10-14 17:54:36 +02:00