test(linux): add regression tests for cli tools to autopkgtests 🍲
This change adds tests that execute km-package-install, km-package-list-installed, and km-package-uninstall and verifies the results. We have two sets of tests, for both gnome-shell and ibus-proper environments.
fix(linux): install schema during `keyman-config/build.sh install`
- improve documentation for installing km-config
- install schema during `keyman-config/build.sh install`
- remove schema during `keyman-config/build.sh uninstall`
- improve two scenarios when running `keyman-config/build.sh install`:
- on newer Ubuntu versions it's no longer possible to directly install Python packages, so we have to use a virtual environment. This change detects a virtual environment and installs into that.
- detect if we're running directly as `root` user instead of `sudo` and explicitly install into `/usr/local`.
- remove obsolete targets from Makefile. `make deb` no longer worked, so this change removes it. The other removed targets in the Makefile were just calling `./build.sh` and so are not really necessary and not used.
- update packaging documentation
Fixes: #14943
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
refactor(linux): remove no-longer-needed Python 3.7 code
Our oldest supported Ubuntu version is 22.04 which comes with Python 3.10, so we can remove the code for Python 3.7.
This improves two scenarios when running `keyman-config/build.sh install`:
- on newer Ubuntu versions it's no longer possible to directly install
Python packages, so we have to use a virtual environment. This change
detects a virtual environment and installs into that.
- detect if we're running directly as `root` user instead of `sudo`
and explicitly install into `/usr/local`.
Test-bot: skip
This change adds tests that execute km-package-install,
km-package-list-installed, and km-package-uninstall and verifies the
results. We have two sets of tests, for both gnome-shell and
ibus-proper environments.
Test-bot: skip
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
When running `km-package-install` with `sudo`, cache files owned by
root get created in the users directory. This makes it harder to
replace, and if the user tries to install the keyboard again under his
user account, installation will fail. This change prevents the use
of the cache when running with `sudo`.
Test-bot: skip
When using a different DBus implementation `dbus-launch` might not exist,
but instantiating a `SessionBus` object might start a session dbus if
it's not already running. This change also replaces the `dbus-x11`
dependency with `default-dbus-session-bus | dbus-session-bus` and changes
the way we detect if dbus is already running.
Also remove `DBUS_SESSION_BUS_ADDRESS` from `sudo gsettings` call. It
turns out we don't need this since we execute the `gsettings` command
in the context of the user anyway which connects to the user's session
dbus.
Fixes: #14888
This change suppresses the output of ending the processes started for
the test run. The output doesn't help much but clutters the overall
output and shows up as warnings on TC.
maint(linux): fix integration tests in Docker
This PR allows the integration tests to work when running them in a Docker container. Also fixes things when running on TC's Ubuntu 24.04 Noble build agent, and improves the behavior when running directly on a developer's machine (previously typing stopped working after the tests...).
Also fixes building mcompile in a Docker container.
Fixes: #13887
This improves running the integration tests on a developer's machine.
While the tests did run fine it was no longer possible to type after
running the tests. The reason was that starting the `ibus-daemon` for
testing together with `mutter` replaced some processes that belonged to
the `ibus-daemon` of the session.
This change now checks if ibus is still functional after killing the
testing `ibus-daemon` (by checking the current engine with `ibus engine`).
Otherwise it kills the lonely remaining `ibus-daemon` and restarts `ibus`.
Test-bot: skip
This change improves our `.shellcheckrc` file so that several directives
are no longer needed and source files are still found. Also remove some
directives that are no longer necessary, either because the changes to
`.shellcheckrc` makes them obsolete, or because the lines changed so
that they no longer contain the problem.
Also remove some shellcheck warnings.
Build-bot: skip
Test-bot: skip
This adds a `--remote-debug` option to `resources/docker-images/run.sh`.
If specified the container will expose `localhost:2345` for remote
debugging inside of the container.
This is useful for debugging integration tests in the container.
Build-bot: skip
Test-bot: skip
It looks like we no longer need these lintian overrides:
- `package-contains-documentation-outside-usr-share-doc` got resolved
by excluding these directories from our source package
- the other one was a false positive that looks like it got fixed in
Debian
`onboard-keyman` isn't available on Debian/Ubuntu and doesn't work
properly with Wayland. This change removes the `onboard-keyman`
recommends which used to cause `onboard-keyman` to be installed
automatically together with `keyman`. The user can still manually install
`onboard-keyman`.
Fixes: #14769Fixes: #5214
Build-bot: skip
Test-bot: skip
- add breadcrumbs with keyboard details
- add some more information about system
- mark files in `km_config` as to the app belonging
- some refactorings
Test-bot: skip
Using `if var := func():` syntax outputs a warning
`FutureWarning: The behavior of this method will change in future
versions. Use specific 'len(elem)' or 'elem is not None' test instead.`
in Python 3.12. This change works around this warning.
Test-bot: skip
Some keyboards seem to be missing the `keyboards` section in the
`kmp.json` file. This change prevents a crash and instead returns `None`
and thus we don't create a .ldml file and so onboard will show the
default keyboard instead. The alternative would be to create an empty
.ldml file, but that causes onboard to show a keyboard with all key caps
being empty.
Fixes: #14707
Fixes: KEYMAN-LINUX-8P
Test-bot: skip
All commands from `linux/Makefile` are now available elsewhere and not
used anymore. The one exception was `make tmpsources` - this change
moves the code to the TC build script.
Test-bot: skip
This change creates a temporary worktree for creating Debian packages. This will allow us to work from a clean state of the source repo. Also exclude any generated patch directories (`.pc`).
This generates the `--tar-ignore`s to avoid having to manually maintain the list when adding new files or folders for other platforms. Instead now we have a list of files and directories to include, and a list of exceptions to exclude from the includes. From that we generate the tar-ignore list.
Fixes: #14563