]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/recycle-test
0745b88e23cb1322de7e02c3b6815cf71d3c63ac
[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 bin/bacula stop 2>&1 >/dev/null
13 bin/drop_sqlite_tables
14 bin/make_sqlite_tables
15
16 echo " "
17 echo " "
18 echo " === Starting recycle-test  ==="
19 echo " === Starting recycle-test  ===" >working/log
20 echo " "
21
22 bin/bacula start 2>&1 >/dev/null
23 bin/console -c bin/console.conf <<END_OF_DATA
24 @output /dev/null
25 messages
26 label storage=File1 volume=TestVolume001
27 label storage=File1 volume=TestVolume002
28 label storage=File1 volume=TestVolume003
29 update Volume=TestVolume001 volretention=10s
30 update Volume=TestVolume001 maxvoljobs=1
31 update Volume=TestVolume002 volretention=10s
32 update Volume=TestVolume002 maxvoljobs=1
33 update Volume=TestVolume003 volretention=10s
34 update Volume=TestVolume003 maxvoljobs=1
35 list volumes
36 run job=NightlySave storage=File1 level=full yes
37 wait
38 messages
39 list volumes
40 run job=NightlySave storage=File1 level=full yes
41 wait
42 messages
43 list volumes
44 run job=NightlySave storage=File1 level=full yes
45 wait
46 messages
47 list volumes
48 @sleep 10
49 run job=NightlySave storage=File1 level=full yes
50 wait
51 messages
52 list volumes
53 run job=NightlySave storage=File1 level=full yes
54 wait
55 messages
56 @output tmp/log1.out
57 list volumes
58 run job=NightlySave storage=File1 level=full yes
59 wait
60 messages
61 list volumes
62 @# 
63 @# now do a restore
64 @#
65 @output tmp/log2.out
66 restore where=${cwd}/tmp/bacula-restores current all
67 yes
68 wait
69 messages
70 @output
71 quit
72 END_OF_DATA
73 bin/bacula stop 2>&1 >/dev/null
74 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
75 bstat=$?
76 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
77 rstat=$?
78 diff -r build  tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
79 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
80    echo " "
81    echo " "
82    echo "  !!!!! recycle-test Bacula source failed!!! !!!!! "
83    echo "  !!!!! recycle-test failed!!! !!!!! " >>test.out
84    echo " "
85 else
86    echo "  ===== recycle-test Bacula source OK ===== "
87    echo "  ===== recycle-test OK ===== " >>test.out
88    scripts/cleanup
89 fi