]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/incremental-tape
Final changes
[bacula/bacula] / regress / tests / incremental-tape
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 cwd=`pwd`
7
8 scripts/copy-tape-confs
9 scripts/cleanup-tape
10 echo "${cwd}/tmp/build" >/tmp/file-list
11 if test ! -d ${cwd}/tmp/build ; then
12    mkdir ${cwd}/tmp/build
13 fi
14 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
15 cd ${cwd}/tmp
16 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
17 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
18 cd ${cwd}
19
20 echo " "
21 echo " "
22 echo " === Starting incremental-tape test ==="
23 echo " === Starting incremental-tape test ===" >>working/log
24 echo " "
25
26 bin/bacula start 2>&1 >/dev/null
27 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
28 @output /dev/null
29 messages
30 @output tmp/log1.out
31 label storage=DDS-4 volume=TestVolume001 slot=0
32 run job=NightlySave yes
33 wait
34 messages
35 quit
36 END_OF_DATA
37 scripts/check_for_zombie_jobs storage=DDS-4
38 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
39 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
40 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
41 @output /dev/null
42 messages
43 @output tmp/log1.out
44 run level=Incremental job=NightlySave yes
45 wait
46 messages
47 @# 
48 @# now do a restore
49 @#
50 @output tmp/log2.out
51 restore where=${cwd}/tmp/bacula-restores storage=DDS-4
52 7
53 <${cwd}/tmp/restore-list
54
55 yes
56 wait
57 messages
58 @output
59 quit
60 END_OF_DATA
61 scripts/check_for_zombie_jobs storage=DDS-4
62 bin/bacula stop 2>&1 >/dev/null
63 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
64 bstat=$?
65 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
66 rstat=$?
67 #
68 # Delete .c files because we will only restored the txt files
69 #
70 rm -f tmp/build/*.c
71 diff -r tmp/build tmp/bacula-restores${cwd}/tmp/build 2>&1 >/dev/null
72 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
73    echo " "
74    echo " "
75    echo "  !!!!! incremental-tape test Bacula source failed!!! !!!!! "
76    echo "  !!!!! incremental-tape test failed!!! !!!!! " >>test.out
77    echo " "
78 else
79    echo "  ===== incremental-tape test Bacula source OK ===== "
80    echo "  ===== incremental-tape test OK ===== " >>test.out
81    scripts/cleanup
82 fi