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