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