]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/ansi-label-1t1d-tape
d574b058ae8cc906d85a0e64f7c207002b6b04d1
[bacula/bacula] / regress / tests / ansi-label-1t1d-tape
1 #!/bin/sh
2 #
3 # Test of ANSI labeled tapes
4 #
5 # Run a simple backup of the Bacula build directory 
6 #   to a tape then restore it, we do that twice to ensure that
7 #   we can correctly append to a tape.
8 # We also use the purge and the relabel commands as
9 #   well as a pile of status storage commands.
10 #
11 TestName="ansi-label-1t1d-tape"
12 JobName=backuptape
13 . scripts/functions
14
15 scripts/copy-tape-confs
16 /bin/cp -f scripts/ansi-sd-tape.conf bin/bacula-sd.conf
17 scripts/cleanup-tape
18
19 echo "${cwd}/build" >${cwd}/tmp/file-list
20
21 change_jobname NightlySave $JobName
22 start_test
23
24 # Write out bconsole commands
25 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
26 @output /dev/null
27 messages
28 @$out ${cwd}/tmp/log1.out
29 @#setdebug level=200 storage=DDS-4
30 label storage=DDS-4 volume=Vol001 slot=0 pool=Default
31 purge volume=Vol001
32 relabel pool=Default storage=DDS-4 oldVolume=Vol001 volume=Vol002 slot=0
33 purge volume=Vol002
34 relabel pool=Default storage=DDS-4 oldVolume=Vol002 volume=Vol001 slot=0
35 run job=$JobName yes
36 status storage=DDS-4
37 @sleep 1
38 wait
39 messages
40 @# 
41 @# now do a restore
42 @#
43 @$out ${cwd}/tmp/log2.out
44 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
45 yes
46 wait
47 list volumes
48 messages
49 END_OF_DATA
50
51 run_bacula
52 check_for_zombie_jobs storage=DDS-4
53 stop_bacula
54
55 #
56 # Now do a second backup after making a few changes
57 #
58 touch ${cwd}/build/src/dird/*.c
59 echo "test test" > ${cwd}/build/src/dird/xxx
60
61 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
62 @$out /dev/null
63 messages
64 @$out ${cwd}/tmp/log1.out
65 list volumes
66 @#setdebug level=300 storage=DDS-4
67 run job=$JobName yes
68 wait
69 list volumes
70 messages
71 @# 
72 @# now do a second restore
73 @#
74 @$out ${cwd}/tmp/log2.out
75 list volumes
76 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
77 yes
78 wait
79 list volumes
80 messages
81 @$out
82 quit
83 END_OF_DATA
84
85 run_bacula
86 check_for_zombie_jobs storage=DDS-4
87 stop_bacula
88
89 check_two_logs
90 check_restore_diff
91 end_test