]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/migration-volume-test
Update
[bacula/bacula] / regress / tests / migration-volume-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-volume-test"
9 JobName=MigVolBackup
10 . scripts/functions
11 set_debug 1
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 two jobs (both will be migrated)
39 run job=$JobName yes
40 wait
41 run job=$JobName yes
42 @sleep 1
43 status storage=File       
44 @sleep 1
45 status storage=File
46 @sleep 1
47 status storage=File
48 wait
49 update volume=FileVolume001 VolStatus=Used
50 list volumes
51 @# should migrate two jobs
52 run job=migrate-volume yes
53 list volumes
54 @sleep 3
55 status storage=DiskChanger
56 @sleep 1
57 status storage=DiskChanger
58 @sleep 1
59 status storage=DiskChanger
60 wait
61 messages
62 @# 
63 @# now do a restore
64 @#
65 @$out tmp/log2.out
66 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
67 unmark *
68 mark *
69 done
70 yes
71 wait
72 messages
73 @output
74 quit
75 END_OF_DATA
76
77 run_bacula
78 check_for_zombie_jobs storage=File
79 stop_bacula
80
81 check_two_logs
82 check_restore_diff
83 end_test