test: disable nspawn checks if machine wasn't booted with systemd

Sempaphore containers are not booted with systemd, so machined is not
available, which makes nspawn bail. Just skip nspawn tests in such
environments.

[ -d /run/systemd/system ] is esentially what sd_booted(3) is doing,
but on Ubuntu 15.05, without 'systemd-container' installed, we also
need to check for the presence of the systemd-machined binary.
This commit is contained in:
Daniel Mack
2015-11-19 17:14:44 +01:00
parent dbf43a42b8
commit 3f5c306d38
+3 -1
View File
@@ -1131,7 +1131,9 @@ inst_libdir_file() {
}
check_nspawn() {
[[ -d /sys/fs/cgroup/systemd ]]
[[ -d /sys/fs/cgroup/systemd ]] && \
[[ -d /run/systemd/system ]] && \
[[ -e /lib/systemd/systemd-machined ]]
}