]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/cancel-multiple-test
Tweak correct English in debug output of regress tests
[bacula/bacula] / regress / tests / cancel-multiple-test
1 #!/bin/sh
2 #
3 # Run four concurrent jobs and then cancel 2 of them
4 #
5
6 TestName="cancel-multiple-jobs-test"
7 JobName=concurrent-jobs
8 . scripts/functions
9
10 copy_test_confs
11
12 echo "${cwd}/tmp/largefile" >${cwd}/tmp/file-list
13 if test -c /dev/urandom ; then
14 # Create 56MB file with random data
15 #  echo "Creating a 56MB file with random data ..."
16    dd if=/dev/urandom of=${cwd}/tmp/largefile bs=1024 count=55000 2>&1 1>/dev/null
17 else
18 #  echo "Creating a 56MB file with bacula-dir data ..."
19    dd if=$bin/bacula-dir of=${cwd}/tmp/1 bs=1024 count=1000 2>&1 1>/dev/null
20    cat ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 ${cwd}/tmp/1 >${cwd}/tmp/2
21    rm -f ${cwd}/tmp/1
22    cat ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 ${cwd}/tmp/2 >>${cwd}/tmp/3
23    rm -f ${cwd}/tmp/2
24    cat ${cwd}/tmp/3 ${cwd}/tmp/3 ${cwd}/tmp/3 ${cwd}/tmp/3 ${cwd}/tmp/3 >${cwd}/tmp/largefile
25    rm -f ${cwd}/tmp/3
26 fi 
27
28 #echo "largefile created"
29
30 # Add some jobs and fileset for this test
31 cat <<EOF >>${cwd}/bin/bacula-dir.conf
32 JobDefs {
33   Name = "DefaultJob"
34   Type = Backup
35   Client=rufus-fd 
36   FileSet="Full Set"
37   Storage = File
38   Messages = Standard
39   Pool = Default
40   Write Bootstrap = "/home/kern/bacula/k/regress/working/NightlySave.bsr"
41   Maximum Concurrent Jobs = 10
42   SpoolData=yes
43   Max Run Time = 30min
44   Reschedule On Error = no
45   Reschedule Interval = 10
46   Reschedule Times = 1
47 }
48 Job {
49   Name = RUN4
50   ClientRunBeforeJob="sleep 20"
51   RunScript {
52     Command = "sleep 20"
53     RunsWhen = After
54   }
55   JobDefs = DefaultJob
56 }
57 EOF
58
59
60 change_jobname CompressedTest $JobName
61 start_test
62      
63 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
64 @$out /dev/null
65 messages
66 @$out  ${cwd}/tmp/log1.out
67 label storage=File volume=TestVolume001
68 run job=RUN4 level=Full yes
69 run job=RUN4 level=Full yes
70 run job=RUN4 level=Full yes
71 run job=RUN4 level=Full yes
72 cancel
73 1,3
74 yes
75 wait
76 messages
77 @# 
78 @# now do a restore
79 @#
80 @$out   ${cwd}/tmp/log2.out
81 restore where=${cwd}/tmp/bacula-restores select storage=File
82 unmark *
83 mark *
84 done
85 yes
86 wait
87 messages
88 @output
89 quit
90 END_OF_DATA
91
92 run_bacula
93 check_for_zombie_jobs storage=File
94 stop_bacula
95
96 check_two_logs
97 diff ${cwd}/tmp/largefile  ${cwd}/tmp/bacula-restores${cwd}/tmp/largefile 2>&1 >/dev/null
98 dstat=$?
99 end_test