]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/four-concurrent-jobs-test
Updates
[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
10 echo " "
11 echo " "
12 echo " === Starting four-concurrent-jobs-test at `date +%R:%S` ==="
13 echo " === Starting four-concurrent-jobs-test at `date +%R:%S` ===" >>working/log
14 echo " "
15
16 bin/bacula start 2>&1 >/dev/null
17 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
18 @output /dev/null
19 messages
20 @output tmp/log1.out
21 label storage=File1
22 TestVolume001
23 label storage=File1
24 TestVolume002
25 update Volume=TestVolume001 MaxVolBytes=100000000
26 @#50000000
27 @#12
28 run job=NightlySave level=Full Storage=File1
29 yes
30 reload
31 run job=NightlySave level=Full Storage=File1
32 yes
33 reload
34 run job=NightlySave level=Full Storage=File1
35 yes
36 reload
37 run job=NightlySave level=Full Storage=File1
38 yes
39 reload
40 reload
41 reload
42 reload
43 @sleep 2
44 status dir
45 reload
46 @sleep 5
47 messages
48 reload
49 reload
50 wait
51 reload
52 messages
53 @# 
54 @# now do a restore
55 @#
56 @output tmp/log2.out
57 restore where=${cwd}/tmp/bacula-restores select storage=File1
58 unmark *
59 mark *
60 done
61 yes
62 wait
63 reload
64 reload
65 messages
66 @output
67 quit
68 END_OF_DATA
69 scripts/check_for_zombie_jobs storage=File1
70
71 bin/bacula stop 2>&1 >/dev/null
72 grep "^  Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
73 bstat=$?
74 grep "^  Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
75 rstat=$?
76 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
77 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
78    echo " "
79    echo " "
80    echo "  !!!!! four-concurrent-jobs-test Bacula source failed!!! !!!!! "
81    echo "  !!!!! four-concurrent-jobs-test failed!!! !!!!! " >>test.out
82    if [ $bstat != 0 -o $rstat != 0 ] ; then
83       echo "  !!!!! Bad Job termination status     !!!!! "
84       echo "  !!!!! Bad Job termination status     !!!!! " >>test.out
85    else
86       echo "  !!!!! Restored files differ          !!!!! "
87       echo "  !!!!! Restored files differ          !!!!! " >>test.out
88    fi
89    echo " "
90    exit 1
91 else
92    echo "  ===== four-concurrent-jobs-test Bacula source OK `date +%R:%S` ===== "
93    echo "  ===== four-concurrent-jobs-test OK `date +%R:%S` ===== " >>test.out
94    scripts/cleanup
95    exit 0
96 fi