]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/restore-by-file-test
baculum: Add strip_prefix, add_prefix, add_suffix and regex_where restore options...
[bacula/bacula] / regress / tests / restore-by-file-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 using the compressed option
9 #   then restore it.
10 #
11
12 TestName="restore-by-file-test"
13 JobName=restorebyfile
14 . scripts/functions
15
16 scripts/cleanup
17 scripts/copy-test-confs
18 echo "${cwd}/tmp/build" >${cwd}/tmp/file-list
19 mkdir -p ${cwd}/tmp/build
20 cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build
21 cd ${cwd}/tmp/build
22 ls >../1
23 cd ..
24 sed s%\^%${cwd}/tmp/build/% 1 | sort | uniq >restore-list
25 rm -f 1
26 cd ${cwd}
27
28 change_jobname CompressedTest $JobName
29 start_test
30
31 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
32 @output /dev/null
33 messages
34 @$out ${cwd}/tmp/log1.out
35 label storage=File volume=TestVolume001
36 run job=$JobName yes
37 wait
38 messages
39 @# 
40 @# now run 10 restores
41 @#
42 @$out ${cwd}/tmp/log2.out
43 restore where=${cwd}/tmp/bacula-restores storage=File
44 7
45 <${cwd}/tmp/restore-list
46
47 yes
48 wait
49 restore where=${cwd}/tmp/bacula-restores storage=File
50 7
51 <${cwd}/tmp/restore-list
52
53 yes
54 wait
55 restore where=${cwd}/tmp/bacula-restores storage=File
56 7
57 <${cwd}/tmp/restore-list
58
59 yes
60 wait
61 restore where=${cwd}/tmp/bacula-restores storage=File
62 7
63 <${cwd}/tmp/restore-list
64
65 yes
66 wait
67 restore where=${cwd}/tmp/bacula-restores storage=File
68 7
69 <${cwd}/tmp/restore-list
70
71 yes
72 wait
73 restore where=${cwd}/tmp/bacula-restores storage=File
74 7
75 <${cwd}/tmp/restore-list
76
77 yes
78 wait
79 restore where=${cwd}/tmp/bacula-restores storage=File
80 7
81 <${cwd}/tmp/restore-list
82
83 yes
84 wait
85 restore where=${cwd}/tmp/bacula-restores storage=File
86 7
87 <${cwd}/tmp/restore-list
88
89 yes
90 wait
91 restore where=${cwd}/tmp/bacula-restores storage=File
92 7
93 <${cwd}/tmp/restore-list
94
95 yes
96 wait
97 restore where=${cwd}/tmp/bacula-restores storage=File
98 7
99 <${cwd}/tmp/restore-list
100
101 yes
102 wait
103 restore where=${cwd}/tmp/bacula-restores storage=File
104 7
105 <${cwd}/tmp/restore-list
106
107 yes
108 wait
109 messages
110 quit
111 END_OF_DATA
112
113 run_bacula
114 check_for_zombie_jobs storage=File
115 stop_bacula
116
117 check_two_logs
118 check_restore_tmp_build_diff
119 end_test