]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/scratch-pool-test
29c319ee703dcb0fac0d66c6f37b9bc995f61a17
[bacula/bacula] / regress / tests / scratch-pool-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory 
4 #  to two tapes where the maximum tape file size is set to 1M
5 #  Note, this test simulates the tape filling and writing to
6 #   the next tape. One minor wrinkle: we create the two tapes
7 #   in the Scratch pool, so they should be switched to the Default
8 #   Pool automatically.
9 # We set TestVolume001 to not in the changer, so the algorithm
10 #   should find TestVolume002 and use it rather than blocking.
11 #
12 #  Note we use the viritual disk autochanger
13 #
14 TestName="scratch-pool-test"
15 JobName=scratch-pool
16 . scripts/functions
17
18 . config.out
19 if test x${AUTOCHANGER} = x/dev/null ; then
20    echo "two-volume-test skipped. No autochanger."
21    exit
22 fi
23 cwd=`pwd`
24 scripts/cleanup
25 scripts/copy-2disk-confs
26 scripts/prepare-two-disks
27  
28 echo "${cwd}/build" >/tmp/file-list
29
30 outf="tmp/sed_tmp"
31 echo "s%# Maximum File Size%  Maximum File Size%g" >${outf}
32 cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
33 sed -f ${outf} ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
34
35 change_jobname NightlySave $JobName
36 start_test
37
38 # Write out bconsole commands
39 cat <<END_OF_DATA >tmp/bconcmds
40 @$out /dev/null
41 messages
42 @$out tmp/log1.out
43 label storage=DDS-4 volume=TestVolume001 slot=1 pool=Scratch drive=0
44 label storage=DDS-4 volume=TestVolume002 slot=2 pool=Scratch drive=0
45 update Volume=TestVolume001 MaxVolBytes=2000000 pool=Scratch drive=0
46 update Volume=TestVolume001 inchanger=no pool=Scratch drive=0
47 @#setdebug level=200 storage=DDS-4
48 llist volume=TestVolume001
49 llist volume=TestVolume002
50 run job=$JobName yes
51 wait
52 messages
53 list volumes
54 llist volume=TestVolume001
55 @# 
56 @# now do a restore
57 @#
58 @$out tmp/log2.out
59 restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
60 yes
61 wait
62 messages
63 @$out
64 quit
65 END_OF_DATA
66
67 run_bacula
68 check_for_zombie_jobs storage=DDS-4
69 stop_bacula
70
71 check_two_logs
72 check_restore_diff
73 end_test