]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/short-incremental-test
4079d120dbdbc94db8ef79feee59be4f05562153
[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=500 dir
33 setdebug level=200 storage=File
34 setdebug level=200 client
35 @#setdebug level=100 director
36 label storage=File volume=TestVolume001
37 label storage=File volume=TestVolume002
38 label storage=File volume=TestVolume003
39 label storage=File volume=TestVolume004
40 run job=$JobName yes
41 status client
42 wait
43 messages
44 quit
45 END_OF_DATA
46
47
48 run_bacula
49 check_for_zombie_jobs storage=File
50 #
51 # Now create two new files to be restored later
52 #
53 sleep 1
54 echo "ficheriro1.txt" >${tmpsrc}/ficheriro1.txt
55 cp -f ${tmpsrc}/dird.c ${tmpsrc}/ficheriro2.txt
56 # set Volumes as read-only
57 chmod -w $tmp/TestVolume001
58 chmod -w $tmp/TestVolume002
59
60 cat <<END_OF_DATA >${tmp}/bconcmds
61 @output /dev/null
62 messages
63 @$out ${tmp}/log1.out
64 @# Force Incremental on the second Volume
65 @#update volume=TestVolume001 VolStatus=Used
66 setdebug level=4 storage=File
67 setdebug level=4 client
68 run level=Differential job=$JobName yes
69 wait
70 messages
71 quit
72 END_OF_DATA
73
74 run_bconsole
75
76 cat <<END_OF_DATA >${tmp}/bconcmds
77 @output /dev/null
78 messages
79 @$out ${tmp}/log1.out
80 setdebug level=4 storage=File
81 run level=Incremental job=$JobName yes
82 wait
83 llist volumes
84 wait
85 messages
86 @# 
87 @# now do a restore
88 @#
89 @$out ${tmp}/log2.out
90 setdebug level=10 storage=File
91 restore where=${tmp}/bacula-restores storage=File file=<${tmp}/restore-list
92 yes
93 wait
94 status dir
95 status client
96 status storage=File
97 messages
98 quit
99 END_OF_DATA
100
101 run_bconsole
102 check_for_zombie_jobs storage=File
103 stop_bacula
104
105 check_two_logs
106 #
107 # Delete .c files because we will only restored the txt files
108 #
109 rm -f ${tmpsrc}/*.c
110 check_restore_tmp_build_diff
111 end_test