]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/migration-job-test
Update new debugging method
[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 . config.out
13
14 scripts/cleanup
15 scripts/copy-migration-confs
16 scripts/prepare-two-disks
17 echo "${cwd}/build" >/tmp/file-list
18
19 change_jobname NightlySave $JobName
20 start_test
21
22 #
23 # Note, we first backup into Pool Default, 
24 #          then Migrate into Pool Full. 
25 #              Pool Default uses Storage=File
26 #              Pool Full    uses Storage=DiskChanger
27
28 # Write out bconsole commands
29 cat <<END_OF_DATA >tmp/bconcmds
30 @output
31 messages
32 @$out tmp/log1.out
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 run job=migrate-job yes
45 wait
46 messages
47 @# purge volume=FileVolume001
48 list jobs 
49 list volumes
50 wait
51 @# 
52 @# now do a restore
53 @#
54 @$out tmp/log2.out
55 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
56 unmark *
57 mark *
58 done
59 yes
60 wait
61 messages
62 @output
63 quit
64 END_OF_DATA
65
66 run_bacula
67 check_for_zombie_jobs storage=File
68 stop_bacula
69
70 check_two_logs
71 check_restore_diff
72 end_test