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