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