Repository navigation
tests/utmpx: check logind timestamps and leader PIDs - #16231
mattsu2020 wants to merge 6 commits into
Conversation
|
GNU testsuite comparison: |
|
Binary size comparison: |
|
Personally, I prefer the zbus-based approach because I find it allows for cleaner code. |
592c75f to
0a0ba42
Compare
| # * cargo | ||
| cdylib | ||
| doctest | ||
| libloading |
There was a problem hiding this comment.
I added this because the spell checker reported an error.
Merging this PR will regress 3 benchmarks2 warnings, 1 note
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
There was a problem hiding this comment.
I think we can use binaries provided by systemd itself at our test and remove unsafe dlopen.
There was a problem hiding this comment.
I'm running some basic tests, but it looks like we can remove it.
e3aedcd to
699d00d
Compare
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-22.04, ubuntu-24.04] |
There was a problem hiding this comment.
Ubuntu 22.04 tests the D-Bus fallback used by older systemd versions.
Ubuntu 24.04 tests direct access through newer sd-login APIs.
Both are needed to cover these different code paths.
If testing just one of them is sufficient, I'll consolidate them into one.
There was a problem hiding this comment.
ubuntu-22.04 runner image is deprecated and will be retired in April 2027, how can we test it then?
There was a problem hiding this comment.
Ubuntu's LTS support period is relatively short. How about using Debian instead? I think that could work.
There was a problem hiding this comment.
GitHub does not provide it. Do we really need to care about legacy API?
We should support what user want to do at 1st.
There was a problem hiding this comment.
I think it would be better to run CI/CD tests only on the latest version and remove the Ubuntu 22.04 image.
Since we already have unit tests in place, I believe this should be sufficient.
e0739b0 to
fbd195c
Compare
29b8266 to
139931e
Compare
139931e to
66dc25c
Compare
Open and validate a nonblocking descriptor, then select it for libc via /proc/self/fd. Keep getutxent for record reads and locking. Cover FIFO rejection, path replacement, invalid inputs and cleanup.
Keep the selected file across iterators and share one lock-wait budget across records. Cover path persistence, lock contention, and cleanup.
Cover both standard and daylight saving time in who output.
Keep display suffixes on host names and distinguish them from IPv6 colons.
Prefer traditional records for a populated default utmp and for explicit paths. Query session timestamps and leader PIDs when needed, and display question marks when logind cannot provide them.
Compare who and pinky fields against loginctl on Ubuntu 22.04 and 24.04, including question marks when sd-login cannot supply the metadata.
66dc25c to
b1ac67f
Compare
| systemd_logind = ["uucore/systemd_logind"] | ||
| uucore = { workspace = true, features = [ | ||
| "libc", | ||
| "utmpx", |
|
|
||
| [features] | ||
| systemd_logind = ["uucore/systemd_logind"] | ||
| uucore = { workspace = true, features = ["utmpx", "systemd-logind", "entries"] } |
|
|
||
| [target.'cfg(any(target_vendor = "apple", target_os = "cygwin", target_os = "freebsd", target_os = "linux", target_os = "netbsd"))'.dependencies] | ||
| uucore = { workspace = true, features = ["utmpx"] } | ||
| uucore = { workspace = true, features = ["utmpx", "systemd-logind"] } |
|
|
||
| [features] | ||
| systemd_logind = ["uucore/systemd_logind"] | ||
| uucore = { workspace = true, features = ["utmpx", "systemd-logind"] } |
| update-control = ["parser"] | ||
| utf8 = [] | ||
| utmpx = ["time", "time/macros", "libc", "dns-lookup"] | ||
| systemd-logind = ["utmpx", "dep:libloading"] |
| # "test_risky_names" == enable tests that create problematic file names (would make a network share inaccessible to Windows, breaks SVN on Mac OS, etc.) | ||
| test_risky_names = [] | ||
| # Linux logind integration tests. | ||
| test_logind = ["who", "pinky", "users", "uptime"] |
|
does each commit stand alone, or should they be squashed? |
Check the login time in
who -uandpinky, and the session leader PID inwho -u. Verify that each field displays?when sd-login cannot supply its value.Depends on #11579.