diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2013-01-25 22:19:19 +0100 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2013-01-25 22:29:56 +0100 |
commit | c90feab4ff8bc23d88d4f9c67d9652ba189cb51b (patch) | |
tree | 3c180b31e08bc4d3627962429fc2584802a7a85c /test/TEST-02-CRYPTSETUP/test.sh | |
parent | e8a66f4af296dc1dd4879a1401eb42bf7b7aeb01 (diff) |
test: factor out testsuite.target, end.service
Tests can use the same testsuite.target.
Add end.service to call poweroff instead of doing it from ExecStopPost
where it may be skipped on failure of ExecStart.
Diffstat (limited to 'test/TEST-02-CRYPTSETUP/test.sh')
-rwxr-xr-x | test/TEST-02-CRYPTSETUP/test.sh | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/test/TEST-02-CRYPTSETUP/test.sh b/test/TEST-02-CRYPTSETUP/test.sh index a0e4d6580d..e0945313f8 100755 --- a/test/TEST-02-CRYPTSETUP/test.sh +++ b/test/TEST-02-CRYPTSETUP/test.sh @@ -122,15 +122,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 +133,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 --no-block 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 |