]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/virtual-backup2-test
regress: tweak the message in the update_win32()
[bacula/bacula] / regress / tests / virtual-backup2-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory then do a 
4 #   Virtual Full backup to another device.
5 #
6 # This script uses the disk autochanger
7 #
8 TestName="virtual-backup-test"
9 JobName=Vbackup
10 . scripts/functions
11
12
13 scripts/cleanup
14 scripts/copy-virtual-confs
15 scripts/prepare-disk-changer
16 echo "${cwd}/build" >${cwd}/tmp/file-list
17
18 change_jobname NightlySave $JobName
19 start_test
20
21 #
22 # Note, we first backup into Pool Default, 
23 #          then Migrate into Pool Full. 
24 #              Pool Default forced to use Storage=DiskChanger
25 #              Pool Full    uses Storage=DiskChanger
26
27 # Write out bconsole commands
28 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
29 @$out /dev/null
30 messages
31 @$out ${cwd}/tmp/log1.out
32 setdebug level=150 storage=DiskChanger
33 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Default drive=0
34 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Default drive=0
35 label storage=DiskChanger volume=ChangerVolume003 slot=3 Pool=Default drive=0
36 label storage=DiskChanger volume=ChangerVolume004 slot=4 Pool=Full drive=0
37 label storage=DiskChanger volume=ChangerVolume005 slot=5 Pool=Full drive=0
38 setdebug level=0 storage=DiskChanger
39 @# run several jobs
40 @exec "sh -c 'date > ${cwd}/build/date'"
41 run job=$JobName level=Full storage=DiskChanger yes
42 wait
43 messages
44 list jobs
45 list volumes
46 @exec "sh -c 'touch ${cwd}/build/src/dird/*.c'"
47 run job=$JobName level=Incremental storage=DiskChanger yes
48 wait
49 messages
50 list jobs
51 list volumes
52 @exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
53 run job=$JobName level=Differential storage=DiskChanger yes
54 wait
55 messages
56 list jobs
57 list volumes
58 @exec "sh -c 'date > ${cwd}/build/date'"
59 @exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
60 run job=$JobName level=Incremental storage=DiskChanger yes
61 wait
62 messages
63 list jobs
64 list volumes
65 @# 
66 @# now do a restore
67 @#
68 @$out ${cwd}/tmp/log2.out
69 restore where=${cwd}/tmp/bacula-restores select
70 unmark *
71 mark *
72 done
73 yes
74 wait
75 list jobs
76 list volumes
77 @#setdebug level=100 dir
78 @#
79 @# Now do a Virtual backup
80 @#
81 setdebug level=151 storage=DiskChanger
82 run job=$JobName level=VirtualFull storage=DiskChanger yes
83 wait
84 messages
85 list jobs
86 list volumes
87 @# 
88 @# now do a restore of the Virtual backup
89 @#
90 @$out ${cwd}/tmp/log2.out
91 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
92 unmark *
93 mark *
94 done
95 yes
96 wait
97 @# Move Volume to Default pool
98 update Volume=ChangerVolume002
99 11
100 Default
101 list jobs
102 list volumes
103 messages
104 @exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
105 @#
106 @# Do an incremental on top of the Virtual Full
107 @#
108 run job=$JobName level=Incremental storage=DiskChanger yes
109 wait
110 messages
111 list jobs
112 list volumes
113 @#
114 @# Now do another Consolidation
115 @#
116 setdebug level=150 storage=DiskChanger
117 run job=$JobName level=VirtualFull storage=DiskChanger yes
118 wait
119 messages
120 list volumes
121 list jobs
122 @# 
123 @# now do a restore should restore from new Virtual backup
124 @#
125 @$out ${cwd}/tmp/log2.out
126 setdebug level=0 storage=DiskChanger
127 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
128 unmark *
129 mark *
130 done
131 yes
132 wait
133 list jobs
134 list volumes
135 messages
136 quit
137 END_OF_DATA
138
139 run_bacula
140 check_for_zombie_jobs storage=DiskChanger
141 stop_bacula
142
143 check_two_logs
144 check_restore_diff
145 end_test