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