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