]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: disable nspawn checks if machine wasn't booted with systemd
authorDaniel Mack <daniel@zonque.org>
Thu, 19 Nov 2015 13:39:18 +0000 (14:39 +0100)
committerDaniel Mack <daniel@zonque.org>
Thu, 19 Nov 2015 16:14:44 +0000 (17:14 +0100)
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.

test/test-functions

index 5d223dbc63e5f997f27aea7c1853dcdcbd58a5fc..f8f89996b42328ea0f3331ad2df605866baba02d 100644 (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 ]]
 }