]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/four-concurrent-jobs-tape
d082bbfd3cb895ef3e7ea7e3830f6f39a3526d14
[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 bin/drop_sqlite_tables
8 bin/make_sqlite_tables
9 scripts/copy-tape-confs
10 scripts/cleanup-tape
11 echo "${cwd}/build" >/tmp/file-list
12
13 echo " "
14 echo " "
15 echo " === Starting four-concurrent-jobs-tape  ==="
16 echo " === Starting four-concurrent-jobs-tape  ===" >>working/log
17 echo " "
18
19 #bin/bacula start 2>&1 >/dev/null
20 bin/bacula start
21 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
22 @output /dev/null
23 messages
24 @output tmp/log1.out
25 label storage=DDS-4 volume=TestVolume001 slot=0
26 run job=NightlySave level=Full Storage=DDS-4 yes
27 run job=NightlySave level=Full Storage=DDS-4 yes
28 run job=NightlySave level=Full Storage=DDS-4 yes
29 run job=NightlySave level=Full Storage=DDS-4 yes
30 @sleep 2
31 status dir
32 @sleep 5
33 messages
34 wait
35 messages
36 @# 
37 @# now do a restore
38 @#
39 @output tmp/log2.out
40 restore where=${cwd}/tmp/bacula-restores select all
41 yes
42 wait
43 messages
44 @output
45 quit
46 END_OF_DATA
47 bin/bacula stop 2>&1 >/dev/null
48 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
49 bstat=$?
50 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
51 rstat=$?
52 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
53 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
54    echo " "
55    echo " "
56    echo "  !!!!! four-concurrent-jobs-tape Bacula source failed!!! !!!!! "
57    echo "  !!!!! four-concurrent-jobs-tape failed!!! !!!!! " >>test.out
58    echo " "
59    exit 1
60 else
61    echo "  ===== four-concurrent-jobs-tape Bacula source OK ===== "
62    echo "  ===== four-concurrent-jobs-tape OK ===== " >>test.out
63    scripts/cleanup
64    exit 0
65 fi