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