X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=test%2FTEST-03-JOBS%2Ftest-jobs.sh;fp=test%2FTEST-03-JOBS%2Ftest-jobs.sh;h=0000000000000000000000000000000000000000;hb=62b7106671d04f70d7f6b49e9d53e637d116b0db;hp=28368b70e4b792e3e7b45ce6bd557b5ad12fa3e0;hpb=ccb03fc9015e6c8131e4d289a36e0145eaf2b5a2;p=elogind.git diff --git a/test/TEST-03-JOBS/test-jobs.sh b/test/TEST-03-JOBS/test-jobs.sh deleted file mode 100755 index 28368b70e..000000000 --- a/test/TEST-03-JOBS/test-jobs.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -x - -# Test merging of a --ignore-dependencies job into a previously -# installed job. - -systemctl start --no-block hello-after-sleep.target -# sleep is now running, hello/start is waiting. Verify that: -systemctl list-jobs > /root/list-jobs.txt -grep 'sleep\.service.*running' /root/list-jobs.txt || exit 1 -grep 'hello\.service.*waiting' /root/list-jobs.txt || exit 1 - -# This is supposed to finish quickly, not wait for sleep to finish. -START_SEC=$(date -u '+%s') -systemctl start --ignore-dependencies hello -END_SEC=$(date -u '+%s') -ELAPSED=$(($END_SEC-$START_SEC)) - -[ "$ELAPSED" -lt 3 ] || exit 1 - -# sleep should still be running, hello not. -systemctl list-jobs > /root/list-jobs.txt -grep 'sleep\.service.*running' /root/list-jobs.txt || exit 1 -grep 'hello\.service' /root/list-jobs.txt && exit 1 -systemctl stop sleep.service hello-after-sleep.target || exit 1 - -# Test for a crash when enqueueing a JOB_NOP when other job already exists -systemctl start --no-block hello-after-sleep.target || exit 1 -# hello.service should still be waiting, so these try-restarts will collapse -# into NOPs. -systemctl try-restart --fail hello.service || exit 1 -systemctl try-restart hello.service || exit 1 -systemctl stop hello.service sleep.service hello-after-sleep.target || exit 1 - -# TODO: add more job queueing/merging tests here. - -# Test for irreversible jobs -systemctl start unstoppable.service || exit 1 - -# This is expected to fail with 'job cancelled' -systemctl stop unstoppable.service && exit 1 -# But this should succeed -systemctl stop --irreversible unstoppable.service || exit 1 - -# We're going to shutdown soon. Let's see if it succeeds when -# there's an active service that tries to be unstoppable. -# Shutdown of the container/VM will hang if not. -systemctl start unstoppable.service || exit 1 - -touch /testok -exit 0