• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openSUSE / agama / 9211232291
72%

Build:
DEFAULT BRANCH: master
Ran 23 May 2024 04:09PM UTC
Jobs 3
Files 763
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 May 2024 04:01PM UTC coverage: 69.873% (-0.02%) from 69.892%
9211232291

push

github

web-flow
Use a timeout when calling `setxkbmap` (#1249)

## Problem

- When calling `setxkbmap` in development the `root` user might not have
access to the `:0` X display.
- Maybe there is XDM running or another user is logged in. In that case
`setxkbmap` prints
  ```
  Authorization required, but no authorization protocol specified
  ```
  error message in an infinite loop and gets stuck.
- Additionally the $DISPLAY might be already set so we should honor that
value (e.g. when you manually start the web server from terminal)

## Solution

- Use the [subprocess](https://crates.io/crates/subprocess) crate to
limit the execution time
- Use the current `DISPLAY` value when already set

### SSH X Forwarding Problem

We need to set the display for the `setxkbmap` call when running on the
Live ISO because when running Agama from systemd service the `DISPLAY`
is not set but we need to access the locally running web browser so we
have to explicitly set the `:0` value.

When the web server is started manually from a terminal we should keep
the current value if it is already set. But using the current `DISPLAY`
value might behave a bit unexpectedly when you login to the system via
SSH with X forwarding enabled. In that case the `setxkbmap` call will
query and set (!) keyboard of the remote X server. That might be quite
confusing.

Sure, that is a corner case, but if you select some exotic layout with
complete different mapping like Dvorak then it might not be trivial to
restore your original layout. When using X forwarding the `DISPLAY` is
set to something like `localhost:10.0`, so we should use it only
when it starts with `:` character which means the local X server.

## Testing

- Tested manually

---------

Co-authored-by: Imobach González Sosa <igonzalezsosa@suse.com>

1987 of 2868 branches covered (69.28%)

Branch coverage included in aggregate %.

15 of 34 new or added lines in 1 file covered. (44.12%)

1 existing line in 1 file now uncovered.

18216 of 26046 relevant lines covered (69.94%)

32.31 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
19
39.8
4.08% rust/agama-server/src/l10n/l10n.rs

Uncovered Existing Lines

Lines Coverage ∆ File
1
39.8
4.08% rust/agama-server/src/l10n/l10n.rs
Subprojects
ID Flag name Job ID Ran Files Coverage
3 rust 9211232291.3 23 May 2024 04:09PM UTC 88
23.04
GitHub Action Run
3 web 8937163624.3 03 May 2024 09:49AM UTC 343
75.3
GitHub Action Run
3 service 9174057874.3 21 May 2024 11:42AM UTC 332
85.81
GitHub Action Run
Source Files on build 9211232291
  • Tree
  • List 763
  • Changed 34
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #9211232291
  • 6443351b on github
  • Prev Build on master (#9191654391)
  • Next Build on master (#9222222694)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc