]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/migration-occupancy-test
regress: tweak the message in the update_win32()
[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
13 scripts/cleanup
14 scripts/copy-migration-confs
15 scripts/prepare-disk-changer
16 echo "${cwd}/build" >${cwd}/tmp/file-list
17
18 change_jobname NightlySave $JobName
19 start_test
20
21 #
22 # Note, we first backup into Pool Default, 
23 #          then Migrate into Pool Full. 
24 #              Pool Default uses Storage=File
25 #              Pool Full    uses Storage=DiskChanger
26
27 # Write out bconsole commands
28 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
29 @$out /dev/null
30 messages
31 @$out ${cwd}/tmp/log1.out
32 label storage=File volume=FileVolume001 Pool=Default
33 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
34 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
35 list volumes
36 @# run two jobs (both will be migrated)
37 run job=$JobName yes
38 run job=$JobName yes
39 wait
40 update volume=FileVolume001 VolStatus=Used
41 list volumes
42 @# should migrate two jobs
43 run job=migrate-occupancy yes
44 list volumes
45 wait
46 messages
47 purge volume=FileVolume001
48 wait
49 @# 
50 @# now do a restore
51 @#
52 @$out ${cwd}/tmp/log2.out
53 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
54 unmark *
55 mark *
56 done
57 yes
58 wait
59 messages
60 quit
61 END_OF_DATA
62
63 run_bacula
64 check_for_zombie_jobs storage=File
65 stop_bacula
66
67 check_two_logs
68 check_restore_diff
69 end_test