]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/auto-label-jobmedia-test
baculum: Add strip_prefix, add_prefix, add_suffix and regex_where restore options...
[bacula/bacula] / regress / tests / auto-label-jobmedia-test
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6 #  Try to stress test autolabel by creating lots of new
7 #    volumes. This is to try to show up a bug 8106 where
8 #    at some point when a volume is changed, the JobMedia
9 #    EndFile < StartFile and EndBlock < StartBlock because
10 #    it is picking up the information from the next Volume.
11 #  Note, this does not reproduce the error ...
12 #
13
14 TestName="auto-label-jobmedia-test"
15 JobName=AutoLabel
16 . scripts/functions
17
18 copy_test_confs
19
20 echo "${cwd}/build" >${cwd}/tmp/file-list
21
22 # Default values
23 #  Maximum Volume Jobs = 1
24 #  Maximum Volume Bytes = 1500000
25
26 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
27 sed "s%# Simple Label Format%  Label Format%" ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
28 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
29 sed "s%# Maximum Volume%  Maximum Volume%g" ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
30 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
31 sed "s%Maximum Volume Jobs = 1%Maximum Volume Jobs = 10%g" ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
32 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
33 sed "s%Maximum Volume Bytes = 1500000%Maximum Volume Bytes =45000000%g" ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
34
35 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
36 sed "s%Maximum Concurrent Jobs = 10%Maximum Concurrent Jobs = 100%g" ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
37 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
38 sed "s%Maximum Concurrent Jobs = 4%Maximum Concurrent Jobs = 100%g" ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
39
40
41 change_jobname CompressedTest $JobName
42 start_test
43
44 cat <<END_OF_SCRIPT >${cwd}/tmp/bconcmds
45 @output /dev/null
46 messages
47 @$out ${cwd}/tmp/log1.out
48 messages
49 @#setdebug level=50 storage=File
50 @#setdebug level=50 dir
51 run job=$JobName level=Full storage=File yes
52 run job=$JobName storage=File yes
53 run job=$JobName level=Full storage=File yes
54 run job=$JobName level=full storage=File yes
55 run job=$JobName level=full storage=File yes
56 run job=$JobName level=full storage=File yes
57 run job=$JobName level=full storage=File yes
58 run job=$JobName level=full storage=File yes
59 run job=$JobName level=full storage=File yes
60 run job=$JobName level=full storage=File yes
61 run job=$JobName level=full storage=File yes
62 status dir
63 wait
64 sql
65 select * from JobMedia;
66
67 list volumes
68 messages
69 @# 
70 @# now do a restore
71 @#
72 @$out ${cwd}/tmp/log2.out
73 setdebug level=0 storage=File
74 setdebug level=0 dir
75 restore where=${cwd}/tmp/bacula-restores select storage=File
76 unmark *
77 mark *
78 done
79 yes
80 wait
81 messages
82 @# Now restore JobId=1
83 restore where=${cwd}/tmp/bacula-restores storage=File
84 3
85 1
86 mark *
87 done
88 yes
89 wait
90 messages
91 @# Now restore JobId=3
92 restore where=${cwd}/tmp/bacula-restores storage=File
93 3
94 3
95 mark *
96 done
97 yes
98 wait
99 messages
100 quit
101 END_OF_SCRIPT
102
103 run_bacula
104 check_for_zombie_jobs storage=File
105 stop_bacula
106
107 check_two_logs
108 check_restore_diff
109 end_test