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