]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/migration-occupancy-test
Pull regression truncate-test from Branch-9.1
[bacula/bacula] / regress / tests / migration-occupancy-test
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6
7 #
8 # Run a simple backup of the Bacula build directory then migrate it
9 #   to another device.
10 #
11 # This script uses the virtual disk autochanger
12 #
13 TestName="migration-occupancy-test"
14 JobName=MigrationJobSave
15 . scripts/functions
16
17
18 scripts/cleanup
19 scripts/copy-migration-confs
20 scripts/prepare-disk-changer
21 echo "${cwd}/build" >${cwd}/tmp/file-list
22
23 change_jobname NightlySave $JobName
24 start_test
25
26 #
27 # Note, we first backup into Pool Default, 
28 #          then Migrate into Pool Full. 
29 #              Pool Default uses Storage=File
30 #              Pool Full    uses Storage=DiskChanger
31
32 # Write out bconsole commands
33 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
34 @output /dev/null
35 messages
36 @$out ${cwd}/tmp/log1.out
37 label storage=File volume=FileVolume001 Pool=Default
38 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
39 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
40 list volumes
41 @# run two jobs (both will be migrated)
42 run job=$JobName yes
43 run job=$JobName yes
44 wait
45 update volume=FileVolume001 VolStatus=Used
46 list volumes
47 @# should migrate two jobs
48 run job=migrate-occupancy yes
49 list volumes
50 wait
51 messages
52 purge volume=FileVolume001
53 wait
54 @# 
55 @# now do a restore
56 @#
57 @$out ${cwd}/tmp/log2.out
58 restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
59 unmark *
60 mark *
61 done
62 yes
63 wait
64 messages
65 quit
66 END_OF_DATA
67
68 run_bacula
69 check_for_zombie_jobs storage=File
70 stop_bacula
71
72 check_two_logs
73 check_restore_diff
74 end_test