]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/four-concurrent-jobs-test
Misc
[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 all storage=File1
53 yes
54 wait
55 messages
56 @output
57 quit
58 END_OF_DATA
59
60 bin/bacula stop 2>&1 >/dev/null
61 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
62 bstat=$?
63 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
64 rstat=$?
65 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
66 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
67    echo " "
68    echo " "
69    echo "  !!!!! four-concurrent-jobs-test Bacula source failed!!! !!!!! "
70    echo "  !!!!! four-concurrent-jobs-test failed!!! !!!!! " >>test.out
71    echo " "
72    exit 1
73 else
74    echo "  ===== four-concurrent-jobs-test Bacula source OK ===== "
75    echo "  ===== four-concurrent-jobs-test OK ===== " >>test.out
76    scripts/cleanup
77    exit 0
78 fi