]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/migration-jobspan-test
b81deac81b85a4a0fe2ef9370e3d3b8847ec3acd
[bacula/bacula] / regress / tests / migration-jobspan-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory then migrate it
4 #   to another device.
5 #
6 # Test migrating a job that spans two Volumes
7 #
8 # This script uses the virtual disk autochanger
9 #
10 TestName="migration-jobspan-test"
11 JobName=MigrationJobSpanSave
12 . scripts/functions
13
14 . config.out
15
16 scripts/cleanup
17 scripts/copy-migration-confs
18 scripts/prepare-two-disks
19 echo "${cwd}/build" >/tmp/file-list
20 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
21 sed "s%# Maximum File Size%  Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
22
23
24 change_jobname NightlySave $JobName
25 start_test
26
27 #
28 # Note, we first backup into Pool Default, 
29 #          then Migrate into Pool Full. 
30 #              Pool Default uses Storage=File
31 #              Pool Full    uses Storage=DiskChanger
32
33 # Write out bconsole commands
34 cat <<END_OF_DATA >tmp/bconcmds
35 @output
36 messages
37 @$out tmp/log1.out
38 @#setdebug level=10 dir
39 @#setdebug level=100 storage=File
40 label storage=File volume=FileVolume001 Pool=Default
41 label storage=File volume=FileVolume002 Pool=Default
42 update Volume=FileVolume001 MaxVolBytes=3000000 pool=Default
43 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
44 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
45 list volumes
46 @#
47 run job=$JobName yes
48 @#run job=$JobName yes
49 wait
50 list volumes
51 @#setdebug level=200 dir
52 @# should migrate both Volumes
53 run job=migrate-job yes
54 wait
55 purge volume=FileVolume001
56 purge volume=FileVolume002
57 list volumes
58 list jobs
59 messages
60 wait
61 @# 
62 @# now do a restore
63 @#
64 @$out tmp/log2.out
65 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
66 unmark *
67 mark *
68 done
69 yes
70 wait
71 messages
72 @output
73 quit
74 END_OF_DATA
75
76 run_bacula
77 check_for_zombie_jobs storage=File
78 stop_bacula
79
80 check_two_logs
81 check_restore_diff
82 end_test