chiark / gitweb /
test-login: make the test non-manual
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 12 May 2017 18:25:17 +0000 (14:25 -0400)
committerSven Eden <yamakuzure@gmx.net>
Tue, 25 Jul 2017 07:46:52 +0000 (09:46 +0200)
commitd04b238170998e0cbcc86db0f8ae66c3ee4a14d6
tree51a00c39209b4dcc5d8552ee2b04271cbe57be1b
parent7d9e3a8e50c44608d19ea8a97ee37ac6f300a7f1
test-login: make the test non-manual

test-login.c is largely rewritten to use _cleanup_ and give more meaningful
messages (function names are used instead of creative terms like "active
session", so that when something unexpected is returned, it's much easier to
see what function is responsible).

The monitoring part is only activated if '-m' is passed on the command line.

It runs against the information from /run/elogind/ in the live system, but that
should be OK: logind/sd-login interface is supposed to be stable and both
backwards and forwards compatible.

If not running in a login session, some tests are skipped.

Those two changes together mean that it's possible to run test-login in the
test suite.

Tests for sd_pid_get_{unit,user_unit,slice} are added.
man/sd_pid_get_session.xml
man/sd_session_is_active.xml
src/libelogind/sd-login/test-login.c