]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/incremental-2disk
Update disk tests
[bacula/bacula] / regress / tests / incremental-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
7 #
8 TestName="incremental-2disk-test"
9 JobName=Inc2disk
10 . scripts/functions
11 set_debug 0
12
13 . config.out
14 if test x${AUTOCHANGER} = x/dev/null ; then
15    echo "incremental-2disk test skipped. No autochanger."
16    exit
17 fi
18
19 stop_bacula
20 cd bin
21 ./drop_bacula_tables >/dev/null 2>&1
22 ./make_bacula_tables >/dev/null 2>&1
23 ./grant_bacula_privileges 2>&1 >/dev/null
24 cd ..
25
26 scripts/copy-2disk-confs
27 scripts/prepare-two-disks
28
29 echo "${cwd}/tmp/build" >/tmp/file-list
30 if test ! -d ${cwd}/tmp/build ; then
31    mkdir ${cwd}/tmp/build
32 fi
33 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
34 cd ${cwd}/tmp
35 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
36 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
37 cd ${cwd}
38
39 change_jobname $JobName
40 start_test
41
42 # Write out bconsole commands
43 cat <<END_OF_DATA >tmp/bconcmds
44 @$out /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=0
49 run job=$JobName yes
50 wait
51 messages
52 quit
53 END_OF_DATA
54
55 run_bacula
56
57 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
58 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
59
60
61 cat <<END_OF_DATA >tmp/bconcmds
62 @$out /dev/null
63 messages
64 @$out tmp/log1.out
65 @# Force Incremental on the second Volume
66 update volume=TestVolume001 VolStatus=Used
67 run level=Incremental job=$JobName yes
68 wait
69 messages
70 @# 
71 @# now do a restore
72 @#
73 @$out tmp/log2.out
74 restore where=${cwd}/tmp/bacula-restores 
75 7
76 <${cwd}/tmp/restore-list
77
78 yes
79 wait
80 messages
81 @$out
82 quit
83 END_OF_DATA
84
85 run_bconsole
86
87 check_for_zombie_jobs storage=File
88 stop_bacula
89 #
90 # Delete .c files because we will only restored the txt files
91 #
92 rm -f tmp/build/*.c
93
94 check_two_logs
95 check_restore_tmp_build_diff
96 end_test