]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/differential-test
Attempt to fix timing problem with console-dotcmd-test on FreeBSD
[bacula/bacula] / regress / tests / differential-test
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6
7 #
8 # Run a simple backup of the Bacula build directory then create some           
9 #   new files, do a differential and restore those two files.
10 #
11 TestName="differential-test"
12 JobName=differential
13 . scripts/functions
14
15 scripts/cleanup
16 scripts/copy-test-confs
17 echo "${cwd}/tmp/build" >${cwd}/tmp/file-list
18 mkdir -p ${cwd}/tmp/build
19 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
20 cd ${cwd}/tmp
21 echo "${cwd}/tmp/build/ficheriro1.txt" >restore-list
22 echo "${cwd}/tmp/build/ficheriro2.txt" >>restore-list
23 cd ${cwd}
24
25 change_jobname CompressedTest $JobName
26 start_test
27
28 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
29 @output /dev/null
30 messages
31 @$out ${cwd}/tmp/log1.out
32 setdebug level=100 storage=File
33 label storage=File volume=TestVolume002
34 label storage=File volume=TestVolume001
35 run job=$JobName yes
36 wait
37 messages
38 quit
39 END_OF_DATA
40
41 run_bacula  
42
43 scripts/check_for_zombie_jobs storage=File
44 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
45 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
46
47 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
48 @output /dev/null
49 messages
50 @$out ${cwd}/tmp/log1.out
51 @# Force differential on the second Volume
52 update volume=TestVolume002 VolStatus=Used
53 run level=differential job=$JobName yes
54 wait
55 messages
56 END_OF_DATA
57
58 run_bconsole
59
60 scripts/check_for_zombie_jobs storage=File
61 echo "ficheriro1.txt" >${cwd}/tmp/build/ficheriro1.txt
62 echo "ficheriro2.txt" >${cwd}/tmp/build/ficheriro2.txt
63
64 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
65 @output /dev/null
66 messages
67 @$out ${cwd}/tmp/log1.out
68 run level=incremental job=$JobName yes
69 wait
70 messages
71 @# 
72 @# now do a restore
73 @#
74 @$out ${cwd}/tmp/log2.out
75 restore where=${cwd}/tmp/bacula-restores storage=File file=<${cwd}/tmp/restore-list
76 yes
77 wait
78 messages
79 quit
80 END_OF_DATA
81
82 run_bconsole
83 scripts/check_for_zombie_jobs storage=File
84 stop_bacula
85
86 check_two_logs
87 #
88 # Delete .c files because we will only restore the txt files
89 #
90 rm -f ${cwd}/tmp/build/*.c
91 check_restore_tmp_build_diff
92 end_test