]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/auto-label-test
Make out of freespace non-fatal for removable devices -- i.e. behaves like tape
[bacula/bacula] / regress / tests / auto-label-test
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6 #  Test if Bacula can automatically create a Volume label.
7 #
8
9 TestName="auto-label-test"
10 JobName=AutoLabel
11 . scripts/functions
12
13 copy_test_confs
14
15 echo "${cwd}/build" >${cwd}/tmp/file-list
16
17 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
18 sed "s%# Label Format%  Label Format%" ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
19
20 change_jobname CompressedTest $JobName
21 start_test
22
23 cat <<END_OF_SCRIPT >${cwd}/tmp/bconcmds
24 @$out /dev/null
25 messages
26 @$out ${cwd}/tmp/log1.out
27 status all
28 status all
29 list pools
30 messages
31 @#setdebug level=110 storage=File
32 run job=$JobName storage=File yes
33 list pools
34 list volumes
35 wait
36 sql
37 SELECT StartTime, JobFiles, JobId, Level, count(*) AS nb_jobmedia  
38 FROM JobMedia join Job using (JobId) join Client using (ClientId) 
39 where Client.Name = 'localhost-fd' group by JobId, Level, StartTime, 
40 JobFiles order by JobId desc ;
41
42 messages
43 @# 
44 @# now do a restore
45 @#
46 @$out ${cwd}/tmp/log2.out
47 @#setdebug level=400 storage=File
48 restore where=${cwd}/tmp/bacula-restores select storage=File
49 unmark *
50 mark *
51 count
52 ls *
53 dir *
54 find Makefile
55 pwd
56 lsmark
57 estimate
58 ?
59 help
60 done
61 yes
62 wait
63 messages
64 quit
65 END_OF_SCRIPT
66
67 run_bacula
68 check_for_zombie_jobs storage=File
69 stop_bacula
70
71 check_two_logs
72 check_restore_diff
73 end_test