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