]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/2drive-2disk
Update
[bacula/bacula] / regress / tests / 2drive-2disk
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory then create some           
4 #   new files, do an Incremental and restore those two files.
5 #
6 # This script uses the virtual disk autochanger and two drives
7 #
8 TestName="2drive-2disk"
9 JobName="2drive2disk"
10 . scripts/functions
11
12 scripts/cleanup
13 scripts/copy-2disk-drive-confs
14 scripts/prepare-two-disks
15
16 change_jobname localhost-fd $JobName
17 start_test
18
19 echo "${cwd}/build" >${cwd}/tmp/file-list
20
21 # Turn off Prefer Mounted Volumes so we use 2 drives
22 outf="${cwd}/tmp/sed_tmp"
23 echo "s%# Prefer Mounted Volumes%  Prefer Mounted Volumes%g" >${outf}
24 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
25 # Comment the next line out to write everything to one drive
26 #  otherwise, it writes the two jobs to different drives
27 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
28
29 # Write out bconsole commands
30 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
31 @output /dev/null
32 messages
33 @$out ${cwd}/tmp/log1.out
34 setdebug level=3 dir
35 setdebug level=3 storage=DDS-4
36 setdebug level=3 client
37 label storage=DDS-4 volume=TestVolume001 slot=1 Pool=Default drive=1
38 # label storage=DDS-4 volume=TestVolume002 slot=2 Pool=Default drive=1
39 status storage=DDS-4
40 setdebug level=120 storage=DDS-4
41 run job=NightlySave level=Full yes
42 @sleep 1
43 run job=NightlySave level=Full yes
44 @sleep 1
45 run job=NightlySave level=Full yes
46 @sleep 1
47 run job=NightlySave level=Full yes
48 @sleep 1
49 run job=NightlySave level=Full yes
50 @sleep 3
51 status storage=DDS-4
52 wait
53 list volumes
54 list jobs
55 status storage=DDS-4
56 messages
57 quit
58 END_OF_DATA
59
60 run_bacula
61
62 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
63 @$out /dev/null
64 messages
65 @$out ${cwd}/tmp/log1.out
66 @# Force Incremental on the second Volume
67 # update volume=TestVolume001 VolStatus=Used
68 status storage=DDS-4
69 @#setdebug level=120 storage=DDS-4
70 run level=Incremental job=NightlySave yes
71 wait
72 list volumes
73 status storage=DDS-4
74 messages
75 @# 
76 @# now do a restore
77 @#
78 @$out ${cwd}/tmp/log2.out
79 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
80 yes
81 wait
82 messages
83 @$out
84 quit
85 END_OF_DATA
86
87 run_bconsole
88 check_for_zombie_jobs storage=DDS-4
89 stop_bacula
90
91 check_two_logs
92 check_restore_diff
93
94 end_test