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