]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/ansi-label-1t1d-tape
New tests
[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 require_tape_drive
16
17 scripts/copy-tape-confs
18 /bin/cp -f scripts/ansi-sd-tape.conf bin/bacula-sd.conf
19 scripts/cleanup-tape
20
21 echo "${cwd}/build" >${cwd}/tmp/file-list
22
23 change_jobname NightlySave $JobName
24 start_test
25
26 # Write out bconsole commands
27 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
28 @output /dev/null
29 messages
30 @$out ${cwd}/tmp/log1.out
31 @#setdebug level=200 storage=DDS-4
32 label storage=DDS-4 volume=Vol001 slot=0 pool=Default
33 purge volume=Vol001
34 relabel pool=Default storage=DDS-4 oldVolume=Vol001 volume=Vol002 slot=0
35 purge volume=Vol002
36 relabel pool=Default storage=DDS-4 oldVolume=Vol002 volume=Vol001 slot=0
37 run job=$JobName yes
38 status storage=DDS-4
39 @sleep 1
40 wait
41 messages
42 @# 
43 @# now do a restore
44 @#
45 @$out ${cwd}/tmp/log2.out
46 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
47 yes
48 wait
49 list volumes
50 messages
51 END_OF_DATA
52
53 run_bacula
54 check_for_zombie_jobs storage=DDS-4
55 stop_bacula
56
57 #
58 # Now do a second backup after making a few changes
59 #
60 touch ${cwd}/build/src/dird/*.c
61 echo "test test" > ${cwd}/build/src/dird/xxx
62
63 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
64 @$out /dev/null
65 messages
66 @$out ${cwd}/tmp/log1.out
67 list volumes
68 @#setdebug level=300 storage=DDS-4
69 run job=$JobName yes
70 wait
71 list volumes
72 messages
73 @# 
74 @# now do a second restore
75 @#
76 @$out ${cwd}/tmp/log2.out
77 list volumes
78 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
79 yes
80 wait
81 list volumes
82 messages
83 @$out
84 quit
85 END_OF_DATA
86
87 run_bacula
88 check_for_zombie_jobs storage=DDS-4
89 stop_bacula
90
91 check_two_logs
92 check_restore_diff
93 end_test