]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/copy-jobspan-test
Tweak prototype.conf
[bacula/bacula] / regress / tests / copy-jobspan-test
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 migrate it
9 #   to another device.
10 #
11 # Test copy a job that spans two Volumes
12 #
13 # This script uses the virtual disk autochanger
14 #
15 TestName="copy-jobspan-test"
16 JobName=CopyJobSpanSave
17 . scripts/functions
18
19
20 scripts/cleanup
21 scripts/copy-migration-confs
22 scripts/prepare-disk-changer
23 echo "${cwd}/build" >${cwd}/tmp/file-list
24 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
25 sed "s%# Maximum File Size%  Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
26 sed 's/migrate/copy/g' ${cwd}/bin/bacula-dir.conf > ${cwd}/tmp/1
27 sed 's/Migrate/Copy/g' ${cwd}/tmp/1 > ${cwd}/bin/bacula-dir.conf
28
29 change_jobname NightlySave $JobName
30 start_test
31
32 #
33 # Note, we first backup into Pool Default, 
34 #          then Copy into Pool Full. 
35 #              Pool Default uses Storage=File
36 #              Pool Full    uses Storage=DiskChanger
37
38 # Write out bconsole commands
39 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
40 @output /dev/null
41 messages
42 @$out ${cwd}/tmp/log1.out
43 @#setdebug level=10 dir
44 @#setdebug level=100 storage=File
45 label storage=File volume=FileVolume001 Pool=Default
46 label storage=File volume=FileVolume002 Pool=Default
47 update Volume=FileVolume001 MaxVolBytes=3000000 pool=Default
48 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
49 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
50 list volumes
51 @#
52 run job=$JobName yes
53 @#run job=$JobName yes
54 wait
55 list volumes
56 @#setdebug level=200 dir
57 @# should migrate both Volumes
58 run job=copy-job yes
59 wait
60 purge volume=FileVolume001
61 purge volume=FileVolume002
62 list volumes
63 list jobs
64 messages
65 wait
66 @# 
67 @# now do a restore
68 @#
69 @# Check if JobMedia OK (run under Aligned)
70 sql
71 select jobid, mediaid, firstindex,lastindex,volindex from JobMedia order by jobid,volindex;
72 select * from JobMedia order by jobid,volindex;
73
74 @$out ${cwd}/tmp/log2.out
75 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
76 unmark *
77 mark *
78 done
79 yes
80 wait
81 messages
82 quit
83 END_OF_DATA
84
85 run_bacula
86 check_for_zombie_jobs storage=File
87 stop_bacula
88
89 check_two_logs
90 check_restore_diff
91 end_test