diff options
author | Martin Pitt <martin@piware.de> | 2017-08-07 21:09:21 +0200 |
---|---|---|
committer | Martin Pitt <martin@piware.de> | 2017-08-10 08:43:13 +0200 |
commit | 818567fce693519eda9d7550a9ae21a7fc974b3c (patch) | |
tree | 3f25bf3ad0dff743160b64719a0ae47681b1ff89 /test/TEST-02-CRYPTSETUP | |
parent | 22077c9c91bff600da78bd17f19a02dfcf1a56bd (diff) | |
download | systemd-818567fce693519eda9d7550a9ae21a7fc974b3c.tar.gz |
test: Run qemu/nspawn tests with "set -e"
This catches errors like "ninja not found", missing programs etc. early,
instead of silently ignoring them and trying to boot a broken VM.
In install_config_files(), allow some distro specific files to be absent
(such as /etc/sysconfig/init).
Diffstat (limited to 'test/TEST-02-CRYPTSETUP')
-rwxr-xr-x | test/TEST-02-CRYPTSETUP/test.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/TEST-02-CRYPTSETUP/test.sh b/test/TEST-02-CRYPTSETUP/test.sh index 31eced5809..1280148b58 100755 --- a/test/TEST-02-CRYPTSETUP/test.sh +++ b/test/TEST-02-CRYPTSETUP/test.sh @@ -1,6 +1,7 @@ #!/bin/bash # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh +set -e TEST_DESCRIPTION="cryptsetup systemd setup" TEST_NO_NSPAWN=1 @@ -78,9 +79,9 @@ EOF } test_cleanup() { - umount $TESTDIR/root/var 2>/dev/null + [ -d $TESTDIR/root/var ] && mountpoint $TESTDIR/root/var && umount $TESTDIR/root/var [[ -b /dev/mapper/varcrypt ]] && cryptsetup luksClose /dev/mapper/varcrypt - umount $TESTDIR/root 2>/dev/null + umount $TESTDIR/root 2>/dev/null || true [[ $LOOPDEV ]] && losetup -d $LOOPDEV return 0 } |