]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/vtape-bug-1288
+x the test file
[bacula/bacula] / regress / tests / vtape-bug-1288
1 #!/bin/sh
2 #
3 # Run backups with dummy tape driver
4 # This test setups an Autochanger with 80 slots
5 # and 5 drives (3 LTO3 and 2 LTO1)
6 #
7 # TAPE_DRIVE="$cwd/working/ach/drive0"
8 # TAPE_DRIVE1="$cwd/working/ach/drive0"
9 # AUTOCHANGER="$cwd/working/ach/conf"
10 # USE_VTAPE=yes
11 # AUTOCHANGER_SCRIPT=disk-changer
12
13
14 TestName="vtape-bug-1288"
15 JobName=backup
16 . scripts/functions
17
18 require_vtape
19
20 scripts/cleanup
21 scripts/copy-tape-confs
22 cp scripts/bacula-dir-vtape.conf bin/bacula-dir.conf
23 cp scripts/bacula-sd-vtape.conf bin/bacula-sd.conf
24 sed -i 's/Device {/Device { LabelMedia = yes/' bin/bacula-sd.conf
25 sed -i 's/Pool {/Pool { LabelFormat = "vol"/' bin/bacula-dir.conf
26 sed -i 's/SpoolData = yes/SpoolData = no/' bin/bacula-dir.conf
27 sed -i 's/Maximum Volume Size = 30M//'  bin/bacula-sd.conf
28 sed -i 's/Maximum File Size = 7M//'  bin/bacula-sd.conf
29 sed -i 's!Client Run Before Job = "/bin/sleep 2"!!' bin/bacula-dir.conf
30 scripts/prepare-fake-autochanger
31
32 echo "${cwd}/build" >${cwd}/tmp/file-list
33 echo "${cwd}/build" >>${cwd}/tmp/file-list
34 echo "${cwd}/build" >>${cwd}/tmp/file-list
35 echo "${cwd}/build" >>${cwd}/tmp/file-list
36 echo "${cwd}/build" >>${cwd}/tmp/file-list
37 echo "${cwd}/build" >>${cwd}/tmp/file-list
38 echo "${cwd}/build" >>${cwd}/tmp/file-list
39
40 start_test
41
42 when1=`perl -MPOSIX -e "print strftime('%F %T', localtime(time+5))"`
43
44 clientname=`awk '/Name = .*-fd/ { if (!ok) { print $3 ; ok=1 } }' bin/bacula-dir.conf`
45
46 # Catalog record for cleaning tape "CLN01" successfully created.
47 # CLN01      | Cleaning
48
49 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
50 @$out ${cwd}/tmp/log1.out
51 messages
52 @#label barcodes slots=1-10 pool=Scratch storage=LTO3 drive=0
53 list volumes
54 @$out ${cwd}/tmp/log1.out
55 run storage=File when="$when1" job=NightlySave  pool=Inc     yes
56 run storage=File when="$when1" job=NightlySave2 pool=Inc     yes
57 run storage=File when="$when1" job=NightlySave1 pool=Inc     yes
58 @sleep 6
59 messages
60 wait
61 messages
62 quit
63 END_OF_DATA
64
65 run_bacula
66 check_for_zombie_jobs storage=File $clientname
67
68
69 stop_bacula
70
71 end_test
72