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