summaryrefslogtreecommitdiff
path: root/test/TEST-02-CRYPTSETUP/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/TEST-02-CRYPTSETUP/test.sh')
-rwxr-xr-xtest/TEST-02-CRYPTSETUP/test.sh18
1 files changed, 5 insertions, 13 deletions
diff --git a/test/TEST-02-CRYPTSETUP/test.sh b/test/TEST-02-CRYPTSETUP/test.sh
index 790dc3074c..ec714301c6 100755
--- a/test/TEST-02-CRYPTSETUP/test.sh
+++ b/test/TEST-02-CRYPTSETUP/test.sh
@@ -3,8 +3,7 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
TEST_DESCRIPTION="cryptsetup systemd setup"
-KVERSION=${KVERSION-$(uname -r)}
-KERNEL_VER=$(uname -r)
+. $TEST_BASE_DIR/test-functions
# Uncomment this to debug failures
#DEBUGFAIL="systemd.unit=multi-user.target"
@@ -122,15 +121,8 @@ LABEL=systemd / ext3 rw 0 1
/dev/mapper/varcrypt /var ext3 defaults 0 1
EOF
- # setup the testsuite target
- cat >$initdir/etc/systemd/system/testsuite.target <<EOF
-[Unit]
-Description=Testsuite target
-Requires=multi-user.target
-After=multi-user.target
-Conflicts=rescue.target
-AllowIsolate=yes
-EOF
+ # setup the testsuite target and the test ending service
+ cp $TEST_BASE_DIR/{testsuite.target,end.service} $initdir/etc/systemd/system/
# setup the testsuite service
cat >$initdir/etc/systemd/system/testsuite.service <<EOF
@@ -140,11 +132,12 @@ After=multi-user.target
[Service]
ExecStart=/bin/bash -c 'set -x; systemctl --failed --no-legend --no-pager > /failed ; echo OK > /testok; while : ;do systemd-cat echo "testsuite service waiting for /var/log/journal" ; echo "testsuite service waiting for journal to move to /var/log/journal" > /dev/console ; for i in /var/log/journal/*;do [ -d "\$i" ] && echo "\$i" && break 2; done; sleep 1; done; sleep 1; exit 0;'
-ExecStopPost=/usr/bin/systemctl poweroff
Type=oneshot
EOF
+
mkdir -p $initdir/etc/systemd/system/testsuite.target.wants
ln -fs ../testsuite.service $initdir/etc/systemd/system/testsuite.target.wants/testsuite.service
+ ln -fs ../end.service $initdir/etc/systemd/system/testsuite.target.wants/end.service
# make the testsuite the default target
ln -fs testsuite.target $initdir/etc/systemd/system/default.target
@@ -260,5 +253,4 @@ test_cleanup() {
return 0
}
-. $TEST_BASE_DIR/test-functions
do_test "$@"