]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/four-concurrent-jobs-test
Update and add tests
[bacula/bacula] / regress / tests / four-concurrent-jobs-test
1 #!/bin/sh
2 #
3 # Run two jobs at the same time
4 #
5 cwd=`pwd`
6 scripts/copy-test-confs
7 scripts/cleanup
8 echo "${cwd}/build" >/tmp/file-list
9
10 echo " "
11 echo " "
12 echo " === Starting four-concurrent-jobs-test  ==="
13 echo " === Starting four-concurrent-jobs-test  ===" >>working/log
14 echo " "
15
16 bin/bacula start 2>&1 >/dev/null
17 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
18 @output /dev/null
19 messages
20 @output tmp/log1.out
21 label storage=File1
22 TestVolume001
23 label storage=File1
24 TestVolume002
25 update Volume=TestVolume001 MaxVolBytes=100000000
26 @#50000000
27 12
28 run job=NightlySave level=Full Storage=File1
29 yes
30 run job=NightlySave level=Full Storage=File1
31 yes
32 run job=NightlySave level=Full Storage=File1
33 yes
34 run job=NightlySave level=Full Storage=File1
35 yes
36 @sleep 2
37 status dir
38 @sleep 5
39 messages
40 wait
41 messages
42 @# 
43 @# now do a restore
44 @#
45 @output tmp/log2.out
46 restore where=${cwd}/tmp/bacula-restores select storage=File1
47 unmark *
48 mark *
49 done
50 yes
51 wait
52 messages
53 @output
54 quit
55 END_OF_DATA
56 scripts/check_for_zombie_jobs storage=File1
57
58 bin/bacula stop 2>&1 >/dev/null
59 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
60 bstat=$?
61 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
62 rstat=$?
63 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
64 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
65    echo " "
66    echo " "
67    echo "  !!!!! four-concurrent-jobs-test Bacula source failed!!! !!!!! "
68    echo "  !!!!! four-concurrent-jobs-test failed!!! !!!!! " >>test.out
69    echo " "
70    exit 1
71 else
72    echo "  ===== four-concurrent-jobs-test Bacula source OK ===== "
73    echo "  ===== four-concurrent-jobs-test OK ===== " >>test.out
74    scripts/cleanup
75    exit 0
76 fi