]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/migration-job-test
Make out of freespace non-fatal for removable devices -- i.e. behaves like tape
[bacula/bacula] / regress / tests / migration-job-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 # This script uses the virtual disk autochanger
12 #
13 TestName="migration-job-test"
14 JobName=MigrationJobSave
15 . scripts/functions
16
17
18 scripts/cleanup
19 scripts/copy-migration-confs
20 scripts/prepare-disk-changer
21 echo "${cwd}/build" >${cwd}/tmp/file-list
22
23 change_jobname NightlySave $JobName
24 start_test
25
26 #
27 # Note, we first backup into Pool Default, 
28 #          then Migrate into Pool Full. 
29 #              Pool Default uses Storage=File
30 #              Pool Full    uses Storage=DiskChanger
31
32 # Write out bconsole commands
33 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
34 @output /dev/null
35 messages
36 @$out ${cwd}/tmp/log1.out
37 setdebug level=000 storage=File
38 label storage=File volume=FileVolume001 Pool=Default
39 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
40 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
41 @# run two jobs (both will be migrated)
42 run job=$JobName yes
43 run job=$JobName yes
44 wait
45 list jobs
46 list volumes
47 @#setdebug level=100 dir
48 @# should migrate two jobs
49 @#setdebug level=51 storage=DiskChanger
50 run job=migrate-job yes
51 wait
52 messages
53 @# purge volume=FileVolume001
54 list jobs 
55 list volumes
56 list joblog jobid=6
57 wait
58 @#
59 @# Now do another backup, but level Incremental
60 @#
61 run job=$JobName level=Incremental yes
62 wait
63 messages
64 @#
65 @# This final job that runs should be Incremental and
66 @# not upgraded to full.
67 list jobs
68 @# 
69 @# now do a restore
70 @#
71 @$out ${cwd}/tmp/log2.out
72 list volumes 
73 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
74 unmark *
75 mark *
76 done
77 yes
78 list volumes
79 wait
80 messages
81 quit
82 END_OF_DATA
83
84 run_bacula
85 check_for_zombie_jobs storage=File
86 stop_bacula
87
88 check_two_logs
89 check_restore_diff
90 end_test