]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/recycle-test
Final doc updates
[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.
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/bacula start
24 bin/console -c bin/console.conf <<END_OF_DATA
25 @output /dev/null
26 messages
27 label storage=File1 volume=TestVolume001
28 label storage=File1 volume=TestVolume002
29 label storage=File1 volume=TestVolume003
30 update Volume=TestVolume001 volretention=10s
31 update Volume=TestVolume001 maxvoljobs=1
32 update Volume=TestVolume002 volretention=10s
33 update Volume=TestVolume002 maxvoljobs=1
34 update Volume=TestVolume003 volretention=10s
35 update Volume=TestVolume003 maxvoljobs=1
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 run job=NightlySave storage=File1 level=full yes
46 wait
47 messages
48 list volumes
49 @sleep 10
50 run job=NightlySave storage=File1 level=full yes
51 wait
52 messages
53 list volumes
54 run job=NightlySave storage=File1 level=full yes
55 wait
56 messages
57 @output tmp/log1.out
58 list volumes
59 run job=NightlySave storage=File1 level=full yes
60 wait
61 messages
62 list volumes
63 @# 
64 @# now do a restore
65 @#
66 @output tmp/log2.out
67 restore where=${cwd}/tmp/bacula-restores current all
68 yes
69 wait
70 messages
71 @output
72 quit
73 END_OF_DATA
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
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