]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/migration-jobspan-test
Pull regression truncate-test from Branch-9.1
[bacula/bacula] / regress / tests / migration-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 migrating a job that spans two Volumes
12 #
13 # This script uses the virtual disk autochanger
14 #
15 TestName="migration-jobspan-test"
16 JobName=MigrationJobSpanSave
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
27
28 change_jobname NightlySave $JobName
29 start_test
30
31 #
32 # Note, we first backup into Pool Default, 
33 #          then Migrate into Pool Full. 
34 #              Pool Default uses Storage=File
35 #              Pool Full    uses Storage=DiskChanger
36
37 # Write out bconsole commands
38 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
39 @output /dev/null
40 messages
41 @$out ${cwd}/tmp/log1.out
42 @#setdebug level=10 dir
43 @#setdebug level=100 storage=File
44 label storage=File volume=FileVolume001 Pool=Default
45 label storage=File volume=FileVolume002 Pool=Default
46 update Volume=FileVolume001 MaxVolBytes=3000000 pool=Default
47 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
48 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
49 list volumes
50 @#
51 run job=$JobName yes
52 @#run job=$JobName yes
53 wait
54 list volumes
55 @#setdebug level=200 dir
56 @# should migrate both Volumes
57 run job=migrate-job yes
58 wait
59 purge volume=FileVolume001
60 purge volume=FileVolume002
61 list volumes
62 list jobs
63 messages
64 wait
65 @# 
66 @# now do a restore
67 @#
68 @$out ${cwd}/tmp/log2.out
69 setdebug level=500 storage=File
70 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
71 unmark *
72 mark *
73 done
74 yes
75 wait
76 messages
77 quit
78 END_OF_DATA
79
80 run_bacula
81 check_for_zombie_jobs storage=File
82 stop_bacula
83
84 check_two_logs
85 check_restore_diff
86 end_test