]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/differential-test
ebl add runscript regression script (not yet works well)
[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 set_debug 0
10
11 scripts/cleanup
12 scripts/copy-test-confs
13 echo "${cwd}/tmp/build" >/tmp/file-list
14 mkdir ${cwd}/tmp/build
15 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
16 cd ${cwd}/tmp
17 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
18 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
19 cd ${cwd}
20
21 change_jobname CompressedTest $JobName
22 start_test
23
24 cat <<END_OF_DATA >tmp/bconcmds
25 @$out /dev/null
26 messages
27 @$out tmp/log1.out
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 >tmp/bconcmds
43 @$out /dev/null
44 messages
45 @$out 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 >tmp/bconcmds
60 @$out /dev/null
61 messages
62 @$out tmp/log1.out
63 run level=incremental job=$JobName yes
64 wait
65 messages
66 @# 
67 @# now do a restore
68 @#
69 @$out 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 tmp/build/*.c
87 check_restore_tmp_build_diff
88 end_test