Repository navigation
tests/utmpx: check logind timestamps and leader PIDs - #16231
mattsu2020 wants to merge 15 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 not alter performance1 warning, 1 note
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.
1fddbf7 to
7497d44
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.
Use one test-only helper for the uucore unit tests and who FIFO test. Keep the helper inside uucore so it is included in the crate package.
e0739b0 to
fbd195c
Compare
| pub(super) leader: Option<u32>, | ||
| } | ||
|
|
||
| pub(super) fn session_details( |
There was a problem hiding this comment.
this costs +58% on who and pinky (~700KB) only for systemd < 254, is it worth it?
printing ? there seems good enough to me
There was a problem hiding this comment.
I'm fine with that approach.
| if record.login_time == UNIX_EPOCH { | ||
| record.login_time = details | ||
| .start_time | ||
| .and_then(|usec| UNIX_EPOCH.checked_add(std::time::Duration::from_micros(usec))) |
There was a problem hiding this comment.
same conversion as line 454, could be dedup
| new_ucmd!() | ||
| .args(args) | ||
| // Argument validation can close stdin before the writer finishes. | ||
| .ignore_stdin_write_error() |
There was a problem hiding this comment.
now called twice, and unrelated to this PR, please drop it from here
Remove the unrelated split test changes from this branch.
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.