]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/differential-test
Fix typo in maxtime-test
[bacula/bacula] / regress / tests / differential-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory then create some           
4 #   new files, do a differential and restore those two files.
5 #
6 TestName="differential-test"
7 JobName=differential
8 . scripts/functions
9
10 scripts/cleanup
11 scripts/copy-test-confs
12 echo "${cwd}/tmp/build" >${cwd}/tmp/file-list
13 mkdir -p ${cwd}/tmp/build
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 change_jobname CompressedTest $JobName
21 start_test
22
23 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
24 @$out /dev/null
25 messages
26 @$out ${cwd}/tmp/log1.out
27 setdebug level=100 storage=File
28 label storage=File volume=TestVolume002
29 label storage=File volume=TestVolume001
30 run job=$JobName yes
31 wait
32 messages
33 quit
34 END_OF_DATA
35
36 run_bacula  
37
38 scripts/check_for_zombie_jobs storage=File
39 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
40 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
41
42 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
43 @$out /dev/null
44 messages
45 @$out ${cwd}/tmp/log1.out
46 @# Force differential on the second Volume
47 update volume=TestVolume002 VolStatus=Used
48 run level=differential job=$JobName yes
49 wait
50 messages
51 END_OF_DATA
52
53 run_bconsole
54
55 scripts/check_for_zombie_jobs storage=File
56 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
57
58 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
59 @$out /dev/null
60 messages
61 @$out ${cwd}/tmp/log1.out
62 run level=incremental job=$JobName yes
63 wait
64 messages
65 @# 
66 @# now do a restore
67 @#
68 @$out ${cwd}/tmp/log2.out
69 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
70 yes
71 wait
72 messages
73 quit
74 END_OF_DATA
75
76 run_bconsole
77 scripts/check_for_zombie_jobs storage=File
78 stop_bacula
79
80 check_two_logs
81 #
82 # Delete .c files because we will only restore the txt files
83 #
84 rm -f ${cwd}/tmp/build/*.c
85 check_restore_tmp_build_diff
86 end_test