]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/incremental-changer
Fix regression on Solaris.
[bacula/bacula] / regress / tests / incremental-changer
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory then create some           
4 #   new files, do an Incremental and restore those two files.
5 #
6 # This script uses the autochanger and two tapes
7 #
8 TestName="incremental-changer"
9 JobName=incrementalchanger
10 . scripts/functions
11
12 require_tape_drive
13 require_autochanger
14
15 scripts/cleanup
16 scripts/copy-2tape-confs
17 scripts/prepare-two-tapes
18
19 echo "${cwd}/tmp/build" >${cwd}/tmp/file-list
20 if test ! -d ${cwd}/tmp/build ; then
21    mkdir -p ${cwd}/tmp/build
22 fi
23 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
24 cd ${cwd}/tmp
25 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
26 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
27 cd ${cwd}
28
29 start_test
30
31 # Write out bconsole commands
32 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
33 @$out /dev/null
34 messages
35 @$out ${cwd}/tmp/log1.out
36 label storage=tape volume=TestVolume001 slot=$SLOT1 Pool=Default drive=$DRIVE1
37 label storage=tape volume=TestVolume002 slot=$SLOT2 Pool=Default drive=$DRIVE1
38 run job=NightlySave yes
39 wait
40 messages
41 quit
42 END_OF_DATA
43
44 run_bacula
45
46 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
47 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
48
49 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
50 @$out /dev/null
51 messages
52 @$out ${cwd}/tmp/log1.out
53 @# Force Incremental on the second Volume
54 update volume=TestVolume001 VolStatus=Used
55 run level=Incremental job=NightlySave yes
56 wait
57 messages
58 @# 
59 @# now do a restore
60 @#
61 @$out ${cwd}/tmp/log2.out
62 restore where=${cwd}/tmp/bacula-restores 
63 7
64 <${cwd}/tmp/restore-list
65
66 yes
67 wait
68 messages
69 quit
70 END_OF_DATA
71
72 run_bconsole
73
74 check_for_zombie_jobs storage=tape
75 stop_bacula
76 check_two_logs
77 rstat=$?
78
79 #
80 # Delete .c files because we will only restored the txt files
81 #
82 rm -f ${cwd}/tmp/build/*.c
83
84 check_restore_tmp_build_diff
85 end_test