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