]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/differential-test
ebl fix more pool problem
[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 ${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 pool=Default
29 label storage=File volume=TestVolume001 pool=Default
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 @$out
52 END_OF_DATA
53
54 run_bconsole
55
56 scripts/check_for_zombie_jobs storage=File
57 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
58
59 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
60 @$out /dev/null
61 messages
62 @$out ${cwd}/tmp/log1.out
63 run level=incremental job=$JobName yes
64 wait
65 messages
66 @# 
67 @# now do a restore
68 @#
69 @$out ${cwd}/tmp/log2.out
70 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
71 yes
72 wait
73 messages
74 @$out
75 quit
76 END_OF_DATA
77
78 run_bconsole
79 scripts/check_for_zombie_jobs storage=File
80 stop_bacula
81
82 check_two_logs
83 #
84 # Delete .c files because we will only restore the txt files
85 #
86 rm -f ${cwd}/tmp/build/*.c
87 check_restore_tmp_build_diff
88 end_test