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