]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/recycle-test
Final changes
[bacula/bacula] / regress / tests / recycle-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory but 
4 #   create three volumes and do six backups causing the
5 #   volumes to be recycled, and cycling through the volumes
6 #   twice. Tests maxvoljobs and volretention.
7 #
8 cwd=`pwd`
9 scripts/copy-test-confs
10 scripts/cleanup
11 echo "${cwd}/build" >/tmp/file-list
12
13 echo " "
14 echo " "
15 echo " === Starting recycle-test  ==="
16 echo " === Starting recycle-test  ===" >working/log
17 echo " "
18
19 bin/bacula start 2>&1 >/dev/null
20 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
21 @output /dev/null
22 messages
23 label storage=File1 volume=TestVolume001
24 label storage=File1 volume=TestVolume002
25 label storage=File1 volume=TestVolume003
26 update Volume=TestVolume001 volretention=10s
27 update Volume=TestVolume001 maxvoljobs=1
28 update Volume=TestVolume002 volretention=10s
29 update Volume=TestVolume002 maxvoljobs=1
30 update Volume=TestVolume003 volretention=10s
31 update Volume=TestVolume003 maxvoljobs=1
32 list volumes
33 run job=NightlySave storage=File1 level=full yes
34 wait
35 messages
36 list volumes
37 run job=NightlySave storage=File1 level=full yes
38 wait
39 messages
40 list volumes
41 run job=NightlySave storage=File1 level=full yes
42 wait
43 messages
44 list volumes
45 @sleep 10
46 run job=NightlySave storage=File1 level=full yes
47 wait
48 messages
49 list volumes
50 run job=NightlySave storage=File1 level=full yes
51 wait
52 messages
53 @output tmp/log1.out
54 list volumes
55 run job=NightlySave storage=File1 level=full yes
56 wait
57 messages
58 list volumes
59 @# 
60 @# now do a restore
61 @#
62 @output tmp/log2.out
63 restore where=${cwd}/tmp/bacula-restores select storage=File1
64 unmark *
65 mark *
66 done
67 yes
68 wait
69 messages
70 @output
71 quit
72 END_OF_DATA
73 scripts/check_for_zombie_jobs storage=File1
74 bin/bacula stop 2>&1 >/dev/null
75 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
76 bstat=$?
77 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
78 rstat=$?
79 diff -r build  tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
80 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
81    echo " "
82    echo " "
83    echo "  !!!!! recycle-test Bacula source failed!!! !!!!! "
84    echo "  !!!!! recycle-test failed!!! !!!!! " >>test.out
85    echo " "
86 else
87    echo "  ===== recycle-test Bacula source OK ===== "
88    echo "  ===== recycle-test OK ===== " >>test.out
89    scripts/cleanup
90 fi