+@$out ${cwd}/tmp/logfile10.out
+@################################################################
+@# test with a broken runscript and a short AfterJob
+@# we break the backup during the backup
+@# Expect: print sleep 40
+@################################################################
+update volume=TestVolume003 volstatus=Used
+label volume=TestVolume004 storage=File pool=Default
+update volume=TestVolume004 MaxVolBytes=1MB
+run job=RUN_ERR4 yes
+@sleep 20
+messages
+st dir
+time
+cancel
+yes
+@sleep 5
+messages
+st dir
+wait
+time
+messages
+@$out ${cwd}/tmp/logfile11.out
+@################################################################
+@# Test to cancel the job immediately
+@# Expect: duration < 30
+@################################################################
+label volume=TestVolume005 storage=File pool=Default
+run job=$JobName yes
+time
+cancel
+yes
+@sleep 5
+messages
+st dir
+wait
+time
+messages
+@$out ${cwd}/tmp/logfile12.out
+@################################################################
+@# Test to cancel the job before it starts
+@# Expect:
+@################################################################
+run job=$JobName when="$when" yes
+@sleep 5
+st dir
+cancel
+yes
+time
+@sleep 5
+messages
+st dir
+wait
+time
+messages