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