]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/2drive-incremental-2tape
Update new debugging method
[bacula/bacula] / regress / tests / 2drive-incremental-2tape
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 autochanger and two tapes
7 #
8 . config.out
9 if test x${TAPE_DRIVE1} = x/dev/null ; then
10    echo "Skipping 2drive-incremenatal-2tape test. No second drive."
11    exit
12 fi
13 TestName="2drive-incremental-2tape"
14 JobName="2drive2tape"
15 . scripts/functions
16
17 scripts/copy-2drive-confs
18 scripts/cleanup-2drive
19
20 change_jobname localhost-fd $JobName
21
22 echo "${cwd}/tmp/build" >/tmp/file-list
23 if test ! -d ${cwd}/tmp/build ; then
24    mkdir ${cwd}/tmp/build
25 fi
26 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
27 cd ${cwd}/tmp
28 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
29 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
30 cd ${cwd}
31
32 # Turn off Prefer Mounted Volumes so we use 2 drives
33 outf="tmp/sed_tmp"
34 echo "s%# Prefer Mounted Volumes%  Prefer Mounted Volumes%g" >${outf}
35 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
36 # Comment the next line out to write everything to one drive
37 #  otherwise, it writes the two jobs to different drives
38 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
39
40 start_test
41
42 # Write out bconsole commands
43 cat <<END_OF_DATA >tmp/bconcmds
44 @output /dev/null
45 messages
46 @$out tmp/log1.out
47 label storage=DDS-4 volume=TestVolume001 slot=1 Pool=Default drive=0
48 label storage=DDS-4 volume=TestVolume002 slot=2 Pool=Default drive=1
49 @#setdebug level=100 storage=DDS-4
50 run job=NightlySave yes
51 run job=NightlySave yes
52 run job=NightlySave yes
53 run job=NightlySave yes
54 run job=NightlySave yes
55 @sleep 3
56 status storage=DDS-4
57 wait
58 list volumes
59 list jobs
60 status storage=DDS-4
61 messages
62 quit
63 END_OF_DATA
64
65 run_bacula
66
67 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
68 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
69
70 cat <<END_OF_DATA >tmp/bconcmds
71 @$out /dev/null
72 messages
73 @$out tmp/log1.out
74 @# Force Incremental on the second Volume
75 update volume=TestVolume001 VolStatus=Used
76 status storage=DDS-4
77 @#setdebug level=400 storage=DDS-4
78 run level=Incremental job=NightlySave yes
79 wait
80 list volumes
81 status storage=DDS-4
82 messages
83 @# 
84 @# now do a restore
85 @#
86 @$out tmp/log2.out
87 restore where=${cwd}/tmp/bacula-restores 
88 7
89 <${cwd}/tmp/restore-list
90
91 yes
92 wait
93 messages
94 @$out
95 quit
96 END_OF_DATA
97
98 run_bconsole
99 check_for_zombie_jobs storage=DDS-4
100 stop_bacula
101
102 check_two_logs
103 #
104 # Delete .c files because we will only restored the txt files
105 #
106 rm -f tmp/build/*.c
107 check_restore_tmp_build_diff
108
109 end_test