]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/relabel-tape
regress: Add test for bvfs-test with deleted files
[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 @$out /dev/null
23 messages
24 @$out ${cwd}/tmp/log1.out
25 setdebug level=150 storage=tape
26 label storage=tape volume=TestVolume001 slot=0 pool=Default
27 run job=$JobName level=Full yes
28 wait
29 messages
30 add pool=Default storage=tape
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=tape
41 unmount storage=tape
42 purge volume=TestVolume001
43 relabel oldvolume=TestVolume001 volume=TestVolume003 slot=0 pool=Default storage=tape
44 list volumes
45 mount storage=tape
46 messages
47 wait
48 run job=$JobName level=Full yes
49 wait
50 list volumes
51 messages
52 quit
53 END_OF_DATA
54
55 run_bacula
56 check_for_zombie_jobs storage=tape
57
58
59 echo "Backup done"
60
61 # now do several restores to ensure we cleanup between jobs
62 #
63 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
64 @$out ${cwd}/tmp/log2.out
65 setdebug level=150 storage=tape
66 list volumes
67 restore where=${cwd}/tmp/bacula-restores select all done
68 yes
69 wait
70 restore where=${cwd}/tmp/bacula-restores select all done
71 yes
72 wait
73 @$out ${cwd}/tmp/log2.out
74 @#
75 @# now unmount the tape and start two restores
76 @#  at the same time
77 @#
78 list volumes
79 unmount storage=tape
80 restore where=${cwd}/tmp/bacula-restores select all done
81 yes
82 restore where=${cwd}/tmp/bacula-restores select
83 unmark *
84 mark *
85 done
86 yes
87 mount storage=tape
88 wait
89 messages
90 quit
91 END_OF_DATA
92
93 run_bconsole
94
95 check_for_zombie_jobs storage=tape
96 stop_bacula
97
98 check_two_logs
99 check_restore_diff
100 end_test