]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/migration-time-test
Final changes
[bacula/bacula] / regress / tests / migration-time-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-time-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 list volumes
38 @# run three jobs
39 run job=$JobName level=Full yes
40 run job=$JobName level=Full yes
41 run job=$JobName level=Full yes
42 wait
43 update volume=FileVolume001 VolStatus=Used
44 sql
45 update Job SET RealEndTime='2004-01-01 12:01:01' WHERE JobId IN (2,3);
46
47 llist jobid=2,3
48 list jobs
49 list volumes
50 @# should migrate only jobid=2 and 3
51 run job=migrate-time yes
52 wait
53 messages
54 wait
55 purge volume=FileVolume001
56 list jobs
57 list volumes
58 @# 
59 @# now do a restore
60 @#
61 @$out tmp/log2.out
62 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
63 unmark *
64 mark *
65 done
66 yes
67 wait
68 messages
69 @output
70 quit
71 END_OF_DATA
72
73 run_bacula
74 check_for_zombie_jobs storage=File
75 stop_bacula
76
77 check_two_logs
78 check_restore_diff
79 end_test