]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/virtual-backup-test
Make test work as expected
[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 setdebug level=100 dir
58 @# should migrate two jobs
59 @#setdebug level=51 storage=DiskChanger
60 run job=$JobName level=VirtualFull yes
61 wait
62 messages
63 list volumes
64 list jobs
65 @# 
66 @# now do a restore
67 @#
68 @$out ${cwd}/tmp/log2.out
69 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
70 unmark *
71 mark *
72 done
73 yes
74 list volumes
75 wait
76 messages
77 @output
78 quit
79 END_OF_DATA
80
81 run_bacula
82 check_for_zombie_jobs storage=File
83 stop_bacula
84
85 check_two_logs
86 check_restore_diff
87 end_test