]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/2drive-2disk
Tweak correct English in debug output of regress tests
[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-disk-changer
15
16 CLIENT=2drive2disk
17
18 change_jobname localhost-fd $JobName
19 start_test
20
21 echo "${cwd}/build" >${cwd}/tmp/file-list
22
23 # Turn off Prefer Mounted Volumes so we use 2 drives
24 outf="${cwd}/tmp/sed_tmp"
25 echo "s%# Prefer Mounted Volumes%  Prefer Mounted Volumes%g" >${outf}
26 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
27 # Comment the next line out to write everything to one drive
28 #  otherwise, it writes the two jobs to different drives
29 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
30
31 # Write out bconsole commands
32 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
33 @$out /dev/null
34 messages
35 @$out ${cwd}/tmp/log1.out
36 setdebug level=3 dir
37 setdebug level=3 storage=tape
38 setdebug level=3 client=$CLIENT
39 label storage=tape volume=TestVolume001 slot=1 Pool=Default drive=1
40 # label storage=tape volume=TestVolume002 slot=2 Pool=Default drive=1
41 status storage=tape
42 setdebug level=120 storage=tape
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 1
51 run job=NightlySave level=Full yes
52 @sleep 3
53 status storage=tape
54 wait
55 list volumes
56 list jobs
57 status storage=tape
58 messages
59 quit
60 END_OF_DATA
61
62 run_bacula
63
64 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
65 @$out /dev/null
66 messages
67 @$out ${cwd}/tmp/log1.out
68 @# Force Incremental on the second Volume
69 # update volume=TestVolume001 VolStatus=Used
70 status storage=tape
71 @#setdebug level=120 storage=tape
72 run level=Incremental job=NightlySave yes
73 wait
74 list volumes
75 status storage=tape
76 messages
77 @# 
78 @# now do a restore
79 @#
80 @$out ${cwd}/tmp/log2.out
81 restore where=${cwd}/tmp/bacula-restores select all storage=tape done
82 yes
83 wait
84 messages
85 @output
86 quit
87 END_OF_DATA
88
89 run_bconsole
90 check_for_zombie_jobs storage=tape
91 stop_bacula
92
93 check_two_logs
94 check_restore_diff
95
96 end_test