]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/six-vol-test
baculum: Add strip_prefix, add_prefix, add_suffix and regex_where restore options...
[bacula/bacula] / regress / tests / six-vol-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 # Create a 60MB file with random bytes. Back it up to 6 Volumes
9 #   each constrained to 10MB using the automatic labeling feature.
10 #
11 TestName="six-vol-test"
12 JobName=SixVol
13 . scripts/functions
14
15 if test ! -c /dev/urandom ; then
16    echo "No random device. Test skipped.\n"
17    exit 0
18 fi
19
20 scripts/cleanup
21 scripts/copy-testa-confs
22 # copy special conf file
23 /bin/cp -f scripts/testb-bacula-dir.conf bin/bacula-dir.conf
24
25 echo "${cwd}/tmp/largefile" >${cwd}/tmp/file-list
26 # Create 56MB file with random data
27 echo "Creating a 56MB file with random data ..."
28 dd if=/dev/urandom of=${cwd}/tmp/largefile bs=1024 count=55000 >/dev/null 2>&1
29 echo "largefile created"
30
31 change_jobname MultiVol $JobName
32 start_test
33
34 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
35 @output /dev/null
36 messages
37 @$out ${cwd}/tmp/log1.out
38 setdebug level=50 storage=File
39 run job=$JobName storage=File yes
40 run job=$JobName storage=File yes
41 run job=$JobName storage=File yes
42 run job=$JobName storage=File yes
43 run job=$JobName storage=File yes
44 wait
45 list volumes
46 messages
47 @# 
48 @# now do a restore
49 @#
50 @$out ${cwd}/tmp/log2.out
51 sql
52 select * from JobMedia where JobId=4;
53 select * from JobMedia where JobId=5;
54
55 setdebug level=50 storage=File
56 restore where=${cwd}/tmp/bacula-restores select storage=File
57 unmark *
58 mark *
59 done
60 yes
61 wait
62 messages
63 quit
64 END_OF_DATA
65
66 run_bacula
67 check_for_zombie_jobs storage=File
68 stop_bacula
69
70 check_two_logs
71 #diff ${cwd}/tmp/largefile  ${cwd}/tmp/bacula-restores${cwd}/tmp/largefile 2>&1 >/dev/null
72 diff ${cwd}/tmp/largefile  ${cwd}/tmp/bacula-restores${cwd}/tmp/largefile
73 dstat=$?
74 end_test