Systemd/src
Zbigniew Jędrzejewski-Szmek ac5644635d test-login: skip consistency checks when logind is not active
There are two ways in swich sd_login_* functions acquire data:
some are derived from the cgroup path, but others use the data serialized
by logind.

When the tests are executed under Fedora's mock, without systemd-spawn
but instead in a traditional chroot, test-login gets confused:
the "outside" cgroup path is visible, so sd_pid_get_unit() and
sd_pid_get_session() work, but sd_session_is_active() and other functions
that need logind data fail.

Such a buildroot setup is fairly bad, but it can be encountered in the wild, so
let's just skip the tests in that case.

/* Information printed is from the live system */
sd_pid_get_unit(0, …) → "session-237.scope"
sd_pid_get_user_unit(0, …) → "n/a"
sd_pid_get_slice(0, …) → "user-1000.slice"
sd_pid_get_session(0, …) → "237"
sd_pid_get_owner_uid(0, …) → 1000
sd_pid_get_cgroup(0, …) → "/user.slice/user-1000.slice/session-237.scope"
sd_uid_get_display(1000, …) → "(null)"
sd_uid_get_sessions(1000, …) → [0] ""
sd_uid_get_seats(1000, …) → [0] ""
Assertion 'r >= 0' failed at src/libsystemd/sd-login/test-login.c:104, function test_login(). Aborting.
2020-12-16 18:22:32 +01:00
..
ac-power license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
activate license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
analyze license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
ask-password license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
backlight backlight: add several debug logs and adjust log level of non critical error 2020-11-23 14:35:14 +01:00
basic hostnamed,shared/hostname-setup: expose the origin of the current hostname 2020-12-16 11:03:36 +01:00
binfmt license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
boot efi: Only use arm flags if supported 2020-12-15 12:06:52 +09:00
busctl Merge pull request #17967 from poettering/connect-user-bus 2020-12-15 21:14:01 +01:00
cgls license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
cgroups-agent license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
cgtop license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
core Merge pull request #17799 from yuwata/oss-fuzz-25353 2020-12-16 17:52:35 +01:00
coredump coredumpctl: Add --debugger-args= option 2020-12-16 12:42:53 +09:00
cryptsetup cryptsetup: give command line parameters proper names 2020-12-04 17:49:34 +01:00
debug-generator license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
delta license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
detect-virt license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
dissect license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
environment-d-generator license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
escape license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
firstboot firstboot: clean-up the copied hostname, not argv[] directly, as that's ugly 2020-12-15 18:00:02 +01:00
fsck license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
fstab-generator license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
fuzz Move hostname setup logic to new shared/hostname-setup.[ch] 2020-12-16 11:02:15 +01:00
getty-generator license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
gpt-auto-generator license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
hibernate-resume license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
home tree-wide: fix typo 2020-12-14 12:05:55 +00:00
hostname hostnamed,shared/hostname-setup: expose the origin of the current hostname 2020-12-16 11:03:36 +01:00
hwdb license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
id128 license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
import hostname-util: flagsify hostname_is_valid(), drop machine_name_is_valid() 2020-12-15 17:59:48 +01:00
initctl license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
journal Merge pull request #17799 from yuwata/oss-fuzz-25353 2020-12-16 17:52:35 +01:00
journal-remote fileio: teach read_full_file_full() to read from offset/with maximum size 2020-12-01 14:17:47 +01:00
kernel-install kernel-install: drop redundant "/" 2020-11-24 11:18:40 +01:00
libsystemd test-login: skip consistency checks when logind is not active 2020-12-16 18:22:32 +01:00
libsystemd-network sd-dhcp-client: fix renew/rebind timeout calculation to avoid infinite loop 2020-12-16 19:49:31 +09:00
libudev udev: introduce udev_queue_is_empty() and udev_queue_init() 2020-12-16 02:28:08 +09:00
locale license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
login logind: use free_and_strdup() where appropriate 2020-12-09 10:09:11 +01:00
machine hostname-util: flagsify hostname_is_valid(), drop machine_name_is_valid() 2020-12-15 17:59:48 +01:00
machine-id-setup license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
modules-load license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
mount license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
network networkd: handle ignoring ll gateway being link ll 2020-12-16 17:56:01 +01:00
notify license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
nspawn Move hostname setup logic to new shared/hostname-setup.[ch] 2020-12-16 11:02:15 +01:00
nss-myhostname license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
nss-mymachines nss-mymachines: initialize logging 2020-12-10 20:52:03 +01:00
nss-resolve nss-resolve: initialize logging, log json errors 2020-12-10 20:50:01 +01:00
nss-systemd nss-systemd: initialize logging 2020-12-10 20:51:59 +01:00
oom test: use for(;;) instead of while(true) 2020-11-27 14:35:20 +09:00
partition fileio: teach read_full_file_full() to read from offset/with maximum size 2020-12-01 14:17:47 +01:00
path license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
portable license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
pstore pstore: use log_oom() 2020-11-20 02:59:02 +09:00
quotacheck license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
random-seed license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
rc-local-generator license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
remount-fs license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
reply-password license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
resolve resolved: always take a timestamp when first seeing a packet 2020-12-16 14:20:49 +01:00
rfkill license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
run license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
run-generator license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
shared Merge pull request #17799 from yuwata/oss-fuzz-25353 2020-12-16 17:52:35 +01:00
shutdown tree-wide: update "that that" 2020-11-18 17:23:00 +09:00
sleep license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
socket-proxy license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
stdio-bridge stdio-bridge: add support for --system and --user 2020-12-15 18:01:20 +01:00
sulogin-shell license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
sysctl license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
system-update-generator license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
systemctl Merge pull request #17799 from yuwata/oss-fuzz-25353 2020-12-16 17:52:35 +01:00
systemd sd-netlink: routing policy rule port to fib_rule_hdr 2020-12-17 00:17:32 +09:00
sysusers specifiers: introduce common macros for generating specifier tables 2020-11-25 14:13:02 +09:00
sysv-generator license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
test shared/hostname-setup: add mode where we check what would be set, without doing 2020-12-16 11:02:17 +01:00
time-wait-sync license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
timedate timedate: use localtime_or_gmtime_r() and mktime_or_timegm() 2020-11-21 04:28:45 +09:00
timesync timesync: Make delaying attempts to contact servers configurable 2020-12-15 08:52:51 +09:00
tmpfiles tree-wide: sort specifiers and move common comments to specifier.h 2020-11-25 15:12:27 +09:00
tty-ask-password-agent license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
udev udev: drop license boilerplate 2020-12-16 02:31:44 +09:00
update-done license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
update-utmp tree-wide: use return value of log_xxx_errno() 2020-11-20 02:58:27 +09:00
user-sessions license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
userdb tree-wide: unsetenv cannot fail 2020-11-10 15:52:32 +01:00
vconsole license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
veritysetup veritysetup: also place udev socket dep 2020-12-10 20:44:12 +01:00
version
volatile-root license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
xdg-autostart-generator license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00