]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/incremental-tape
Skip lzo-test if lzo not in Bacula
[bacula/bacula] / regress / tests / incremental-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 # Run a simple backup of the Bacula build directory then create some           
9 #   new files, do an Incremental and restore those two files.
10 #
11 TestName="incremental-tape"
12 JobName=IncTape
13 . scripts/functions
14
15 require_tape_drive
16
17 scripts/copy-tape-confs
18 scripts/cleanup-tape
19
20 echo "${cwd}/tmp/build" >${cwd}/tmp/file-list
21 if test ! -d ${cwd}/tmp/build ; then
22    mkdir -p ${cwd}/tmp/build
23 fi
24 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
25 cd ${cwd}/tmp
26 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
27 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
28 cd ${cwd}
29
30 change_jobname NightlySave $JobName
31 start_test
32
33 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
34 @$out /dev/null
35 messages
36 @$out   ${cwd}/tmp/log1.out
37 label storage=tape volume=TestVolume001 slot=0 pool=Default
38 run job=$JobName yes
39 wait
40 messages
41 quit
42 END_OF_DATA
43
44 run_bacula
45 check_for_zombie_jobs storage=tape
46
47 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
48 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
49
50 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
51 @$out /dev/null
52 messages
53 @$out   ${cwd}/tmp/log1.out
54 run level=Incremental job=$JobName yes
55 wait
56 messages
57 @# 
58 @# now do a restore
59 @#
60 @$out   ${cwd}/tmp/log2.out
61 restore where=${cwd}/tmp/bacula-restores storage=tape
62 7
63 <${cwd}/tmp/restore-list
64
65 yes
66 wait
67 messages
68 quit
69 END_OF_DATA
70
71 run_bconsole
72 check_for_zombie_jobs storage=tape
73 stop_bacula
74
75 #
76 # Delete .c files because we will only restored the txt files
77 #
78 rm -f ${cwd}/tmp/build/*.c
79
80 check_two_logs
81 check_restore_tmp_build_diff
82 end_test