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