]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/incremental-2media
Make out of freespace non-fatal for removable devices -- i.e. behaves like tape
[bacula/bacula] / regress / tests / incremental-2media
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 onto a different medium 
10 #   and then restore everything.
11 #
12 # This script uses the virtual disk autochanger
13 #
14 TestName="incremental-2media"
15 JobName=Inc2media
16 . scripts/functions
17
18
19 scripts/cleanup
20 scripts/copy-2disk-confs
21 scripts/prepare-disk-changer
22 echo "${cwd}/build" >${cwd}/tmp/file-list
23
24 change_jobname $JobName
25 start_test
26
27 # Write out bconsole commands
28 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
29 @$out /dev/null
30 messages
31 @$out ${cwd}/tmp/log1.out
32 label storage=tape volume=TestVolume001 slot=1 Pool=Default drive=0
33 label storage=File volume=TestVolume002 Pool=Default
34 run job=$JobName yes
35 wait
36 messages
37 quit
38 END_OF_DATA
39
40 run_bacula
41
42 # make some files for the incremental to pick up
43 touch ${cwd}/build/src/dird/*.c ${cwd}/build/src/dird/*.o
44 touch ${cwd}/build/src/lib/*.c ${cwd}/build/src/lib/*.o
45
46 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
47 @$out /dev/null
48 messages
49 @$out ${cwd}/tmp/log1.out
50 @# Force Incremental on the second Volume
51 update volume=TestVolume001 VolStatus=Used
52 setdebug level=51 storage=File
53 run level=Incremental job=$JobName storage=File yes
54 wait
55 messages
56 @# 
57 @# now do a restore
58 @#
59 @$out ${cwd}/tmp/log2.out
60 setdebug level=151 storage=tape
61 restore where=${cwd}/tmp/bacula-restores select all done 
62 yes
63 wait
64 restore where=${cwd}/tmp/bacula-restores select all done 
65 yes
66 wait
67 status storage=tape
68 messages
69 quit
70 END_OF_DATA
71
72 run_bconsole
73
74 check_for_zombie_jobs storage=File
75 stop_bacula
76
77 check_two_logs
78 check_restore_diff
79
80 end_test