summaryrefslogtreecommitdiff
path: root/test/test-functions
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2016-06-24 16:23:39 +0200
committerMartin Pitt <martin.pitt@ubuntu.com>2016-06-24 16:23:39 +0200
commit7cad32bbdeed20ac0daf6049ab093db902f4a4e7 (patch)
tree44fffa4c1d97541b33463e6c27929860bd09ea94 /test/test-functions
parentb2ecd099dc7371aafb988145ab40a631f7050d41 (diff)
test: merge check_nspawn() into run_nspawn()
This makes nspawn tests symmetric with run_qemu() which also exits with 1 if QEMU is not available.
Diffstat (limited to 'test/test-functions')
-rw-r--r--test/test-functions9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/test-functions b/test/test-functions
index d8b7109671..4583c02f97 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -108,7 +108,11 @@ $KERNEL_APPEND \
return 0
}
+# Return 0 if nspawn did run (then you must check the result state/logs for actual
+# success), or 1 if nspawn is not available.
run_nspawn() {
+ [[ -d /run/systemd/system ]] || return 1
+
local _nspawn_cmd="../../systemd-nspawn --register=no --kill-signal=SIGKILL --directory=$TESTDIR/nspawn-root $ROOTLIBDIR/systemd $KERNEL_APPEND"
if [[ "$NSPAWN_TIMEOUT" != "infinity" ]]; then
_nspawn_cmd="timeout --foreground $NSPAWN_TIMEOUT $_nspawn_cmd"
@@ -1284,11 +1288,6 @@ inst_libdir_file() {
fi
}
-check_nspawn() {
- [[ -d /run/systemd/system ]]
-}
-
-
do_test() {
if [[ $UID != "0" ]]; then
echo "TEST: $TEST_DESCRIPTION [SKIPPED]: not root" >&2