]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/incremental-changer
Make out of freespace non-fatal for removable devices -- i.e. behaves like tape
[bacula/bacula] / regress / tests / incremental-changer
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 autochanger and two tapes
12 #
13 TestName="incremental-changer"
14 JobName=incrementalchanger
15 . scripts/functions
16
17 require_tape_drive
18 require_autochanger
19
20 scripts/cleanup
21 scripts/copy-2tape-confs
22 scripts/prepare-two-tapes
23
24 exit
25
26 echo "${cwd}/tmp/build" >${cwd}/tmp/file-list
27 if test ! -d ${cwd}/tmp/build ; then
28    mkdir -p ${cwd}/tmp/build
29 fi
30 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
31 cd ${cwd}/tmp
32 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
33 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
34 cd ${cwd}
35
36 start_test
37
38 # Write out bconsole commands
39 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
40 @$out /dev/null
41 messages
42 @$out ${cwd}/tmp/log1.out
43 label storage=tape volume=TestVolume001 slot=$SLOT1 Pool=Default drive=$DRIVE1
44 label storage=tape volume=TestVolume002 slot=$SLOT2 Pool=Default drive=$DRIVE1
45 run job=NightlySave yes
46 wait
47 messages
48 quit
49 END_OF_DATA
50
51 run_bacula
52
53 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
54 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
55
56 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
57 @$out /dev/null
58 messages
59 @$out ${cwd}/tmp/log1.out
60 @# Force Incremental on the second Volume
61 update volume=TestVolume001 VolStatus=Used
62 run level=Incremental job=NightlySave yes
63 wait
64 messages
65 @# 
66 @# now do a restore
67 @#
68 @$out ${cwd}/tmp/log2.out
69 restore where=${cwd}/tmp/bacula-restores 
70 7
71 <${cwd}/tmp/restore-list
72
73 yes
74 wait
75 messages
76 quit
77 END_OF_DATA
78
79 run_bconsole
80
81 check_for_zombie_jobs storage=tape
82 stop_bacula
83 check_two_logs
84 rstat=$?
85
86 #
87 # Delete .c files because we will only restored the txt files
88 #
89 rm -f ${cwd}/tmp/build/*.c
90
91 check_restore_tmp_build_diff
92 end_test