From d710d36375bacbf9cfb8903107bedf2c0aada84e Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Fri, 22 Feb 2013 18:59:07 +0100 Subject: test: test irreversible jobs --- test/TEST-03-JOBS/test-jobs.sh | 13 +++++++++++++ test/TEST-03-JOBS/test.sh | 5 +++-- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'test/TEST-03-JOBS') diff --git a/test/TEST-03-JOBS/test-jobs.sh b/test/TEST-03-JOBS/test-jobs.sh index 98746c5363..12b38af942 100755 --- a/test/TEST-03-JOBS/test-jobs.sh +++ b/test/TEST-03-JOBS/test-jobs.sh @@ -24,5 +24,18 @@ grep 'hello\.service' /root/list-jobs.txt && 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 diff --git a/test/TEST-03-JOBS/test.sh b/test/TEST-03-JOBS/test.sh index bd211f3ad5..6eaba72e57 100755 --- a/test/TEST-03-JOBS/test.sh +++ b/test/TEST-03-JOBS/test.sh @@ -1,7 +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 -TEST_DESCRIPTION="Job merging" +TEST_DESCRIPTION="Job-related tests" KVERSION=${KVERSION-$(uname -r)} KERNEL_VER=$(uname -r) @@ -138,7 +138,8 @@ Type=oneshot EOF # copy the units used by this test - cp $TEST_BASE_DIR/{hello.service,sleep.service,hello-after-sleep.target} $initdir/etc/systemd/system + cp $TEST_BASE_DIR/{hello.service,sleep.service,hello-after-sleep.target,unstoppable.service} \ + $initdir/etc/systemd/system cp test-jobs.sh $initdir/ mkdir -p $initdir/etc/systemd/system/testsuite.target.wants -- cgit v1.2.3-54-g00ecf