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