feat(linux): Start dbus if not running
This change checks the DBus environment variables when initializing the keyman_config module and starts DBus if the variables are not set. This particularly happens when trying to install or uninstall a keyboard for a different user, which will now be possible with this change.
Fixes #9363.
User Testing
Preparations
-
The tests should be run on these Linux platforms:
- GROUP_FOCAL: Ubuntu 20.04 Focal with Gnome Shell and X11
- GROUP_JAMMY_WAYLAND: Ubuntu 22.04 Jammy with Gnome Shell and Wayland
-
Reboot
-
Create a second user
myuserwithout admin privileges
Tests
TEST_INST: Can install a keyboard for the second user
- in a terminal window, login as
myuserby runningsu --login myuser - as
myuserrun:km-package-install -p sil_euro_latin --bcp47 de - verify that this doesn't outputs errors
- logout and login as
myuser - verify that the "German (EuroLatin (SIL))" keyboard appears in the toolbar
- verify that you can switch to and type with that keyboard
TEST_UNINST: Can uninstall a keyboard for the second user
- logout and login as regular user again
- in a terminal window, login as
myuserby runningsu --login myuser - as
myuserrun:km-package-uninstall sil_euro_latin - verify that this doesn't outputs errors
- logout and login as
myuser - verify that the "German (EuroLatin (SIL))" keyboard no longer appears in the toolbar
User Test Results
Test specification and instructions
-
✅ GROUP_FOCAL: Ubuntu 20.04 Focal with Gnome Shell and X11
2 tests PASSED
- ✅ TEST_INST (PASSED): Retested this PR, as per Eberhard's suggestion with the attached PR build (Keyman 17.0.293-beta (package version 17.0.293-1~PR-10863-2581.1+focal1) on Ubuntu 20.04 Focal Linux (X11) and here is my observation : 1. In the terminal window, logged in to myuser. 2. In myuser, run the above-mentioned command line to install sil_euro_latin keyboard. It shows some irrelevant error message on the terminal window. 3. Logged out and logged in as myuser. Verfied that the "German (EuroLatin (SIL))" keyboard appeared in the toolbar. Able to type in that keyboard in the text editor. (notes)
- ✅ TEST_UNINST (PASSED): 1. Logged out and logged in as regular user again. 2. In terminal window, logged in as myuser. 3. As myuser, run the above mentioned command. It shows up some irrelevant error message on the terminal window. 4. Logged out and logged in as myuser. Verified that the "German (EuroLatin (SIL))" keyboard did not appear in the toolbar.
-
✅ GROUP_JAMMY_WAYLAND: Ubuntu 22.04 Jammy with Gnome Shell and Wayland
2 tests PASSED
- ✅ TEST_INST (PASSED): Retested (as per Eberhard's suggestion) with the attached PR build (Keyman 17.0.293-beta (package vesion 17.0.293-1~PR-10863-2581.1+jammy1) on Ubuntu 20.04 Focal Linux (Wayland) and here is my observation : 1. In the terminal window, logged in to myuser. 2. In myuser, run the above mentioned command line to install sil_euro_latin keyboard. It shows up some irrelevant error message on the terminal window. 3. Logged out and logged in as myuser. Verfied that the "German (EuroLatin (SIL))" keyboard appeared in the toolbar. Able to type in that keyboard in the text editor. (notes)
- ✅ TEST_UNINST (PASSED): 1. Logged out and logged in as regular user again. 2. In a terminal window, logged in as myuser. 3. As myuser, run the above mentioned command . It shows up some irrelevant error message on the terminal window. 4. Logged out and logged in as myuser. Verified that the "German (EuroLatin (SIL))" keyboard did not appear in the toolbar.
Test Artifacts
When installing the packages for this PR on Focal it's no longer possible to type with Keyman. Most often the keyboards don't show up, and if they do typing doesn't work.
Things work after rebooting after the installation.
Test Results
GROUP_FOCAL: Ubuntu 20.04 Focal with Gnome Shell and X11
-
TEST_INST (FAILED): Tested with the attached PR build on Ubuntu 20.04 Focal Linux OS (x11) (VM) and here is my observation: 1. Installed the PR build Keyman 17.0.279-beta (package version 17.0.279-1~PR-10863-2470.1+focal1). 2. Restarted the system. 3. Created a second user 'myuser1' without admin privileges. 4. Opened terminal window. Changed to second user 'myuser1'. 5. Ran the above-mentioned command and noticed that it is displaying an error message.
-
TEST_UNINST (FAILED): Tested with the attached PR build on Ubuntu 20.04 Focal Linux OS (x11) (VM) and here is my observation: 1. Restarted the system. 2. Opened terminal window. Changed to second user 'myuser1'. 5. Ran the above-mentioned (uninstall) command and noticed that it is displaying an error message.
Test Results
GROUP_JAMMY_WAYLAND: Ubuntu 22.04 Jammy with Gnome Shell and Wayland
-
TEST_INST (PASSED): Tested with the attached PR build (keyman 17.0.279-beta (package version 17.0.279-1~PR-10863-2470.1+jammy1) on Ubuntu 22.04 Jammy with Gnome Shell and Wayland (Virtual Box) and here is my observation: 1. Created a second user 'myuser' without admin privileges. 2. Changed to second user 'myuser'. 3. Run the above mentioned package-install command on the terminal. 4. Verified it doesn't output any errors. 5. logged out then logged in as 'myuser'. 5. Verified that the "German (EuroLatin(SIL))" keyboard is appearing in the toolbar. 6. Verified that switching to German Keyboard and typing with that keyboard is possible.
Test Results
GROUP_JAMMY_WAYLAND: Ubuntu 22.04 Jammy with Gnome Shell and Wayland
-
TEST_UNINST (PASSED): 1. Logged in as a regular user again. 2. Changed to Second user 'myuser' in the terminal window. 3. Run the above mentioned package-uninstall command and verified that it doesn't output any errors. 4. Logged out then logged in as 'myuser'. Verified that the "German (EuroLatin(SIL))" keyboard doesn't appear in the toolbar. Seems to be working as expected.
GROUP_FOCAL:
- TEST_INST (SKIPPED): error message is unrelated
- TEST_UNINST (SKIPPED): error message is unrelated
@bharanidharanj Could you please run the tests again? I had to change quite a bit. Thanks! Note that on Ubuntu 20.04 Focal you can ignore the "Unable to init server: Could not connect: Connection refused" message.
@keymanapp-test-bot retest
Test Results
GROUP_FOCAL: Ubuntu 20.04 Focal with Gnome Shell and X11
-
TEST_INST (PASSED): Retested this PR, as per Eberhard's suggestion with the attached PR build (Keyman 17.0.293-beta (package version 17.0.293-1~PR-10863-2581.1+focal1) on Ubuntu 20.04 Focal Linux (X11) and here is my observation : 1. In the terminal window, logged in to myuser. 2. In myuser, run the above-mentioned command line to install sil_euro_latin keyboard. It shows some irrelevant error message on the terminal window. 3. Logged out and logged in as myuser. Verfied that the "German (EuroLatin (SIL))" keyboard appeared in the toolbar. Able to type in that keyboard in the text editor.
-
TEST_UNINST (PASSED): 1. Logged out and logged in as regular user again. 2. In terminal window, logged in as myuser. 3. As myuser, run the above mentioned command. It shows up some irrelevant error message on the terminal window. 4. Logged out and logged in as myuser. Verified that the "German (EuroLatin (SIL))" keyboard did not appear in the toolbar.
Test Results
GROUP_JAMMY_WAYLAND: Ubuntu 22.04 Jammy with Gnome Shell and Wayland
-
TEST_INST (PASSED): Retested (as per Eberhard's suggestion) with the attached PR build (Keyman 17.0.293-beta (package vesion 17.0.293-1~PR-10863-2581.1+jammy1) on Ubuntu 20.04 Focal Linux (Wayland) and here is my observation : 1. In the terminal window, logged in to myuser. 2. In myuser, run the above mentioned command line to install sil_euro_latin keyboard. It shows up some irrelevant error message on the terminal window. 3. Logged out and logged in as myuser. Verfied that the "German (EuroLatin (SIL))" keyboard appeared in the toolbar. Able to type in that keyboard in the text editor.
-
TEST_UNINST (PASSED): 1. Logged out and logged in as regular user again. 2. In a terminal window, logged in as myuser. 3. As myuser, run the above mentioned command . It shows up some irrelevant error message on the terminal window. 4. Logged out and logged in as myuser. Verified that the "German (EuroLatin (SIL))" keyboard did not appear in the toolbar.
Changes in this pull request will be available for download in Keyman version 17.0.295-beta