]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/short-incremental-test
a6596dbee2d1d7b9cbb7ed062b3af9c16396af56
[bacula/bacula] / regress / tests / short-incremental-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 an Incremental and restore those two files.
10 #
11 TestName="short-incremental-test"
12 JobName=Incremental 
13 . scripts/functions
14
15 ${rscripts}/cleanup
16 ${rscripts}/copy-test-confs
17 echo "${tmpsrc}" >${tmp}/file-list
18 mkdir -p ${tmpsrc}
19 cp -p ${src}/src/dird/*.c ${tmpsrc}
20 cd ${tmp}
21 echo "${tmpsrc}/ficheriro1.txt" >restore-list
22 echo "${tmpsrc}/ficheriro2.txt" >>restore-list
23 cd ${cwd}
24
25 change_jobname CompressedTest $JobName
26 start_test
27
28 cat <<END_OF_DATA >${tmp}/bconcmds
29 @output /dev/null
30 messages
31 @$out ${tmp}/log1.out
32 setdebug level=200 storage=File
33 setdebug level=200 client
34 @#setdebug level=100 director
35 label storage=File volume=TestVolume001
36 label storage=File volume=TestVolume002
37 run job=$JobName yes
38 status client
39 wait
40 messages
41 quit
42 END_OF_DATA
43
44 run_bacula
45 check_for_zombie_jobs storage=File
46 #
47 # Now create two new files to be restored later
48 #
49 sleep 1
50 echo "ficheriro1.txt" >${tmpsrc}/ficheriro1.txt
51 cp -f ${tmpsrc}/dird.c ${tmpsrc}/ficheriro2.txt
52
53 cat <<END_OF_DATA >${tmp}/bconcmds
54 @output /dev/null
55 messages
56 @$out ${tmp}/log1.out
57 @# Force Incremental on the second Volume
58 @#update volume=TestVolume001 VolStatus=Used
59 setdebug level=4 storage=File
60 setdebug level=4 client
61 run level=Differential job=$JobName yes
62 wait
63 messages
64 quit
65 END_OF_DATA
66
67 run_bconsole
68
69 cat <<END_OF_DATA >${tmp}/bconcmds
70 @output /dev/null
71 messages
72 @$out ${tmp}/log1.out
73 setdebug level=4 storage=File
74 run level=Incremental job=$JobName yes
75 wait
76 messages
77 @# 
78 @# now do a restore
79 @#
80 @$out ${tmp}/log2.out
81 setdebug level=10 storage=File
82 restore where=${tmp}/bacula-restores storage=File file=<${tmp}/restore-list
83 yes
84 wait
85 status dir
86 status client
87 status storage=File
88 messages
89 quit
90 END_OF_DATA
91
92 run_bconsole
93 check_for_zombie_jobs storage=File
94 stop_bacula
95
96 check_two_logs
97 #
98 # Delete .c files because we will only restored the txt files
99 #
100 rm -f ${tmpsrc}/*.c
101 check_restore_tmp_build_diff
102 end_test