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