chiark / gitweb /
sd-login: test - fix failure when run from non-graphical seat
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>
Tue, 8 Aug 2017 15:13:52 +0000 (16:13 +0100)
committerSven Eden <yamakuzure@gmx.net>
Thu, 10 Aug 2017 08:29:08 +0000 (10:29 +0200)
commite11de0cc371a9a358eeb9dcbb088e308cd4033fb
tree0aeb6a4c654669242be33ea0a1dc72d8457efc23
parent07e2d354ebdb689e2c05224c1a720bb7892d67a6
sd-login: test - fix failure when run from non-graphical seat

Observed when running from the console of a elogind 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/libelogind/sd-login/test-login.c:191, function test_login(). Aborting.
src/libelogind/sd-login/test-login.c