]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/four-concurrent-jobs-tape
089f28696af65aaddb305f847a60f4ac73bccb6c
[bacula/bacula] / regress / tests / four-concurrent-jobs-tape
1 #!/bin/sh
2 #
3 # Run two jobs at the same time
4 #
5 cwd=`pwd`
6 bin/bacula stop 2>&1 >/dev/null
7 cd bin
8 ./drop_bacula_tables >/dev/null 2>&1
9 ./make_bacula_tables >/dev/null 2>&1
10 ./grant_bacula_privileges 2>&1 >/dev/null
11 cd ..
12 scripts/copy-tape-confs
13 scripts/cleanup-tape
14 echo "${cwd}/build" >/tmp/file-list
15
16 echo " "
17 echo " "
18 echo " === Starting four-concurrent-jobs-tape  ==="
19 echo " === Starting four-concurrent-jobs-tape  ===" >>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=DDS-4 volume=TestVolume001 slot=0
28 run job=NightlySave level=Full Storage=DDS-4 yes
29 run job=NightlySave level=Full Storage=DDS-4 yes
30 run job=NightlySave level=Full Storage=DDS-4 yes
31 run job=NightlySave level=Full Storage=DDS-4 yes
32 @sleep 2
33 status dir
34 @sleep 5
35 messages
36 wait
37 messages
38 @# 
39 @# now do a restore
40 @#
41 @output tmp/log2.out
42 restore where=${cwd}/tmp/bacula-restores select storage=DDS-4
43 unmark *
44 mark *
45 done
46 yes
47 wait
48 messages
49 @output
50 quit
51 END_OF_DATA
52 scripts/check_for_zombie_jobs storage=DDS-4
53 bin/bacula stop 2>&1 >/dev/null
54 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
55 bstat=$?
56 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
57 rstat=$?
58 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
59 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
60    echo " "
61    echo " "
62    echo "  !!!!! four-concurrent-jobs-tape Bacula source failed!!! !!!!! "
63    echo "  !!!!! four-concurrent-jobs-tape failed!!! !!!!! " >>test.out
64    echo " "
65    exit 1
66 else
67    echo "  ===== four-concurrent-jobs-tape Bacula source OK ===== "
68    echo "  ===== four-concurrent-jobs-tape OK ===== " >>test.out
69    scripts/cleanup
70    exit 0
71 fi