]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/virtual-backup-test
Update
[bacula/bacula] / regress / tests / virtual-backup-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory then do a virtual
4 #   backup to another device.
5 #
6 # This script uses the virtual disk autochanger
7 #
8 TestName="virtual-backup-test"
9 JobName=Vbackup
10 . scripts/functions
11
12
13 scripts/cleanup
14 scripts/copy-migration-confs
15 scripts/prepare-two-disks
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 uses Storage=File
25 #              Pool Full    uses Storage=DiskChanger
26
27 # Write out bconsole commands
28 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
29 @output
30 messages
31 @$out ${cwd}/tmp/log1.out
32 @#setdebug level=100 storage=File
33 label storage=File volume=FileVolume001 Pool=Default
34 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
35 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
36 @# run several jobs
37 run job=$JobName level=Full yes
38 wait
39 messages
40 list jobs
41 @exec "sh -c 'touch ${cwd}/build/src/dird/*.c'"
42 run job=$JobName level=Incremental yes
43 wait
44 messages
45 list jobs
46 @exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
47 run job=$JobName level=Differential yes
48 wait
49 messages
50 list jobs
51 @exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
52 run job=$JobName level=Incremental yes
53 wait
54 messages
55 list jobs
56 list volumes
57 @# 
58 @# now do a restore
59 @#
60 @$out ${cwd}/tmp/log2.out
61 restore where=${cwd}/tmp/bacula-restores select
62 unmark *
63 mark *
64 done
65 yes
66 list volumes
67 @#setdebug level=100 dir
68 @# should Consolidate Full, Differential and Incremental
69 @#setdebug level=51 storage=DiskChanger
70 run job=$JobName level=VirtualFull yes
71 wait
72 messages
73 list volumes
74 list jobs
75 @# 
76 @# now do a restore
77 @#
78 @$out ${cwd}/tmp/log2.out
79 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
80 unmark *
81 mark *
82 done
83 yes
84 wait
85 update Volume=ChangerVolume002
86 11
87 Default
88 list volumes
89 list jobs
90 messages
91 @exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
92 run job=$JobName level=Incremental yes
93 wait
94 messages
95 list jobs
96 list volumes
97 @# Now do another Consolidation
98 setdebug level=150 storage=DiskChanger
99 run job=$JobName level=VirtualFull yes
100 wait
101 messages
102 list volumes
103 list jobs
104 @# 
105 @# now do a restore
106 @#
107 @$out ${cwd}/tmp/log2.out
108 setdebug level=0 storage=DiskChanger
109 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
110 unmark *
111 mark *
112 done
113 yes
114 wait
115 list volumes
116 list jobs
117 messages
118 @output
119 quit
120 END_OF_DATA
121
122 run_bacula
123 check_for_zombie_jobs storage=File
124 stop_bacula
125
126 check_two_logs
127 check_restore_diff
128 end_test