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