]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/relabel-tape
Updates
[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 set_debug 0
11
12 scripts/cleanup-tape
13 scripts/copy-tape-confs
14 echo "${cwd}/build" >/tmp/file-list
15
16 change_jobname $JobName
17 start_test
18
19 cat <<END_OF_DATA >tmp/bconcmds
20 @output /dev/null
21 messages
22 @$out tmp/log1.out
23 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default
24 run job=$JobName level=Full yes
25 wait
26 messages
27 add pool=Default
28 0
29 TestVolume002
30 @# set status to append
31 update volume=TestVolume001
32 1
33 .
34 run job=NightlySave level=Full yes
35 @sleep 20
36 unmount
37 unmount
38 purge volume=TestVolume001
39 relabel oldvolume=TestVolume001 volume=TestVolume003 slot=0 pool=Default
40 list volumes
41 mount
42 messages
43 wait
44 run job=$JobName level=Full yes
45 wait
46 messages
47 @$out
48 quit
49 END_OF_DATA
50
51 run_bacula
52 check_for_zombie_jobs storage=DDS-4
53
54
55 echo "Backup done"
56
57 # now do several restores to ensure we cleanup between jobs
58 #
59 cat <<END_OF_DATA >tmp/bconcmds
60 @$out /dev/null
61 restore where=${cwd}/tmp/bacula-restores select all done
62 yes
63 wait
64 restore where=${cwd}/tmp/bacula-restores select all done
65 yes
66 wait
67 @$out tmp/log2.out
68 @#
69 @# now unmount the tape and start two restores
70 @#  at the same time
71 @#
72 unmount storage=DDS-4
73 restore where=${cwd}/tmp/bacula-restores select all done
74 yes
75 restore where=${cwd}/tmp/bacula-restores select
76 unmark *
77 mark *
78 done
79 yes
80 mount storage=DDS-4
81 wait
82 messages
83 @$out
84 quit
85 END_OF_DATA
86
87 run_bconsole
88
89 check_for_zombie_jobs storage=DDS-4
90 stop_bacula
91
92 check_two_logs
93 check_restore_diff
94 end_test