]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/relabel-tape
f3406811261e753e312fe478ace9d31cc52a1690
[bacula/bacula] / regress / tests / relabel-tape
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory using the compressed option
4 #   then backup four times, each with incremental then finally restore.
5 #   It should require at least 4 different bsrs.
6 #
7 TestName="relabel-tape"
8 JobName=Relabeltape
9 . scripts/functions
10
11 require_tape_drive
12
13 scripts/cleanup-tape
14 scripts/copy-tape-confs
15
16 echo "${cwd}/build" >${cwd}/tmp/file-list
17
18 change_jobname $JobName
19 start_test
20
21 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
22 @output /dev/null
23 messages
24 @$out ${cwd}/tmp/log1.out
25 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
26 run job=$JobName level=Full yes
27 wait
28 messages
29 add pool=Default storage=DDS-4
30 0
31 TestVolume002
32 @# set status to append
33 update volume=TestVolume001
34 1
35 .
36 run job=$JobName level=Full yes
37 wait
38 list volumes
39 unmount storage=DDS-4
40 unmount storage=DDS-4
41 setdebug level=150 storage=DDS-4
42 purge volume=TestVolume001
43 relabel oldvolume=TestVolume001 volume=TestVolume003 slot=0 pool=Default storage=DDS-4
44 list volumes
45 mount storage=DDS-4
46 messages
47 wait
48 setdebug level=0 storage=DDS-4
49 run job=$JobName level=Full yes
50 wait
51 list volumes
52 messages
53 @$out
54 quit
55 END_OF_DATA
56
57 run_bacula
58 check_for_zombie_jobs storage=DDS-4
59
60
61 echo "Backup done"
62
63 # now do several restores to ensure we cleanup between jobs
64 #
65 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
66 @$out /dev/null
67 list volumes
68 restore where=${cwd}/tmp/bacula-restores select all done
69 yes
70 wait
71 restore where=${cwd}/tmp/bacula-restores select all done
72 yes
73 wait
74 @$out ${cwd}/tmp/log2.out
75 @#
76 @# now unmount the tape and start two restores
77 @#  at the same time
78 @#
79 list volumes
80 setdebug level=150 storage=DDS-4
81 unmount storage=DDS-4
82 restore where=${cwd}/tmp/bacula-restores select all done
83 yes
84 restore where=${cwd}/tmp/bacula-restores select
85 unmark *
86 mark *
87 done
88 yes
89 mount storage=DDS-4
90 wait
91 messages
92 @$out
93 quit
94 END_OF_DATA
95
96 run_bconsole
97
98 check_for_zombie_jobs storage=DDS-4
99 stop_bacula
100
101 check_two_logs
102 check_restore_diff
103 end_test