]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/libsystemd/sd-login/test-login.c
sd-login: test - fix failure when run from non-graphical seat 6568/head
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>
Tue, 8 Aug 2017 15:13:52 +0000 (16:13 +0100)
committerAlan Jenkins <alan.christopher.jenkins@gmail.com>
Tue, 8 Aug 2017 15:55:15 +0000 (16:55 +0100)
commite6f44233c64084f331eaf9fbd7761cb8b79bdc36
tree73ad0814e30fcf08782e230e8a762e5362f33d34
parent5947643cc2982fa2fb057cfe5998b4bc92de7e20
sd-login: test - fix failure when run from non-graphical seat

Observed when running from the console of a systemd nspawn container
(see failure below).

The value of r was tested, when r was last set by
sd_session_can_graphical().  This did not correspond to the value expected.

Fix the code, so we compare relevant values now.  Hopefully :).

Test failure
------------

/* Information printed is from the live system */
sd_pid_get_unit(0, …) → "session-13.scope"
sd_pid_get_user_unit(0, …) → "n/a"
sd_pid_get_slice(0, …) → "user-1000.slice"
sd_pid_get_session(0, …) → "13"
sd_pid_get_owner_uid(0, …) → 1000
sd_pid_get_cgroup(0, …) → "/user.slice/user-1000.slice/session-13.scope"
sd_uid_get_display(1000, …) → "13"
sd_uid_get_sessions(1000, …) → [2] "15 13"
sd_uid_get_seats(1000, …) → [1] "seat0"
sd_session_is_active("13") → yes
sd_session_is_remote("13") → no
sd_session_get_state("13") → "active"
sd_session_get_uid("13") → 1000
sd_session_get_type("13") → "tty"
sd_session_get_class("13") → "user"
sd_session_get_display("13") → "n/a"
sd_session_get_remote_user("13") → "n/a"
sd_session_get_remote_host("13") → "n/a"
sd_session_get_seat("13") → "seat0"
sd_session_can_multi_seat("seat0") → no
sd_session_can_tty("seat0") → no
sd_session_can_graphical("seat0") → no
sd_uid_get_state(1000, …) → active
Assertion '!!k == !!r' failed at ../src/libsystemd/sd-login/test-login.c:191, function test_login(). Aborting.
src/libsystemd/sd-login/test-login.c