]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/relabel-tape
add -u to diff
[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 setdebug level=150 storage=DDS-4
26 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
27 run job=$JobName level=Full yes
28 wait
29 messages
30 add pool=Default storage=DDS-4
31 0
32 TestVolume002
33 @# set status to append
34 update volume=TestVolume001
35 1
36 .
37 run job=$JobName level=Full yes
38 wait
39 list volumes
40 unmount storage=DDS-4
41 unmount 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 run job=$JobName level=Full yes
49 wait
50 list volumes
51 messages
52 @$out
53 quit
54 END_OF_DATA
55
56 run_bacula
57 check_for_zombie_jobs storage=DDS-4
58
59
60 echo "Backup done"
61
62 # now do several restores to ensure we cleanup between jobs
63 #
64 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
65 @$out ${cwd}/tmp/log2.out
66 setdebug level=150 storage=DDS-4
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 unmount storage=DDS-4
81 restore where=${cwd}/tmp/bacula-restores select all done
82 yes
83 restore where=${cwd}/tmp/bacula-restores select
84 unmark *
85 mark *
86 done
87 yes
88 mount storage=DDS-4
89 wait
90 messages
91 @$out
92 quit
93 END_OF_DATA
94
95 run_bconsole
96
97 check_for_zombie_jobs storage=DDS-4
98 stop_bacula
99
100 check_two_logs
101 check_restore_diff
102 end_test