]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/virtual-backup-test
Fix xattr/acl regression.
[bacula/bacula] / regress / tests / virtual-backup-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-migration-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 uses Storage=File
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=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 @exec "sh -c 'date > ${cwd}/build/date'"
38 run job=$JobName level=Full yes
39 wait
40 messages
41 list jobs
42 @exec "sh -c 'touch ${cwd}/build/src/dird/*.c'"
43 run job=$JobName level=Incremental yes
44 wait
45 messages
46 list jobs
47 @exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
48 run job=$JobName level=Differential yes
49 wait
50 messages
51 list jobs
52 @exec "sh -c 'date > ${cwd}/build/date'"
53 @exec "sh -c 'touch ${cwd}/build/src/dird/*.o'"
54 run job=$JobName level=Incremental yes
55 wait
56 messages
57 list jobs
58 list volumes
59 @# 
60 @# now do a normal restore of normal backups
61 @#
62 setdebug level=10 dir
63 restore where=${cwd}/tmp/bacula-restores select
64 unmark *
65 mark *
66 done
67 yes
68 list volumes
69 @# should Consolidate Full, Differential and Incremental
70 setdebug level=150 storage=DiskChanger
71 setdebug level=100 dir
72 run job=$JobName level=VirtualFull yes
73 wait
74 messages
75 list volumes
76 list jobs
77 @# 
78 @# now do a restore of the consolidated Full
79 @#
80 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
81 unmark *
82 mark *
83 done
84 yes
85 wait
86 list volumes
87 list jobs
88 messages
89 quit
90 END_OF_DATA
91
92 run_bacula
93 check_for_zombie_jobs storage=File
94 stop_bacula
95
96 #
97 # We only used one log so copy it to the second log
98 #  so that any restore errors will be picked up
99 #
100 cp -f ${cwd}/tmp/log1.out ${cwd}/tmp/log2.out
101 check_two_logs
102 check_restore_diff
103 end_test