]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/differential-test
Delete unwanted subdirectory
[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" >/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 >tmp/bconcmds
24 @$out /dev/null
25 messages
26 @$out tmp/log1.out
27 label storage=File volume=TestVolume002
28 label storage=File volume=TestVolume001
29 run job=$JobName yes
30 wait
31 messages
32 quit
33 END_OF_DATA
34
35 run_bacula  
36
37 scripts/check_for_zombie_jobs storage=File
38 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
39 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
40
41 cat <<END_OF_DATA >tmp/bconcmds
42 @$out /dev/null
43 messages
44 @$out tmp/log1.out
45 @# Force differential on the second Volume
46 update volume=TestVolume002 VolStatus=Used
47 run level=differential job=$JobName yes
48 wait
49 messages
50 @$out
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 >tmp/bconcmds
59 @$out /dev/null
60 messages
61 @$out tmp/log1.out
62 run level=incremental job=$JobName yes
63 wait
64 messages
65 @# 
66 @# now do a restore
67 @#
68 @$out tmp/log2.out
69 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
70 yes
71 wait
72 messages
73 @$out
74 quit
75 END_OF_DATA
76
77 run_bconsole
78 scripts/check_for_zombie_jobs storage=File
79 stop_bacula
80
81 check_two_logs
82 #
83 # Delete .c files because we will only restore the txt files
84 #
85 rm -f tmp/build/*.c
86 check_restore_tmp_build_diff
87 end_test