]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/six-vol-test
8beaeb8d67a85639ef4298a5a24c788c457527cc
[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
7 if test ! -c /dev/urandom ; then
8    echo "No random device. Test skipped.\n"
9    exit 0
10 fi
11 cwd=`pwd`
12 scripts/copy-testa-confs
13 scripts/cleanup
14 echo "${cwd}/tmp/largefile" >/tmp/file-list
15 # Create 56MB file with random data
16 echo "Creating a 56MB file with random data ..."
17 dd if=/dev/urandom of=${cwd}/tmp/largefile bs=1024 count=55000
18 echo "largefile created"
19 bin/bacula stop 2>&1 >/dev/null
20 cd bin
21 ./drop_bacula_tables >/dev/null 2>&1
22 ./make_bacula_tables >/dev/null 2>&1
23 ./grant_bacula_privileges 2>&1 >/dev/null
24 cd ..
25
26 echo " "
27 echo " "
28 echo " === Starting six-vol-test  ==="
29 echo " === Starting six-vol-test  ===" >>working/log
30 echo " "
31
32 bin/bacula start 2>&1 >/dev/null
33 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
34 @output /dev/null
35 messages
36 @output tmp/log1.out
37 run job=MultiVol storage=File yes
38 wait
39 messages
40 @# 
41 @# now do a restore
42 @#
43 @output tmp/log2.out
44 restore where=${cwd}/tmp/bacula-restores select storage=File
45 unmark *
46 mark *
47 done
48 yes
49 wait
50 messages
51 @output
52 quit
53 END_OF_DATA
54 scripts/check_for_zombie_jobs storage=File
55 bin/bacula stop  2>&1 >/dev/null
56 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
57 bstat=$?
58 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
59 rstat=$?
60 diff tmp/largefile  tmp/bacula-restores${cwd}/tmp/largefile 2>&1 >/dev/null
61 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
62    echo " "
63    echo " "
64    echo "  !!!!! six-vol-test Bacula source failed!!! !!!!! "
65    echo "  !!!!! six-vol-test failed!!! !!!!! " >>test.out
66    echo " "
67 else
68    echo "  ===== six-vol-test Bacula source OK ===== "
69    echo "  ===== six-vol-test OK ===== " >>test.out
70    scripts/cleanup
71 fi