]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/six-vol-test
Updates
[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
20 echo " "
21 echo " "
22 echo " === Starting six-vol-test at `date +%R:%S` ==="
23 echo " === Starting six-vol-test at `date +%R:%S` ===" >>working/log
24 echo " "
25
26 bin/bacula start 2>&1 >/dev/null
27 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA 2>&1 >/dev/null
28 @output /dev/null
29 messages
30 @output tmp/log1.out
31 run job=MultiVol storage=File yes
32 wait
33 messages
34 @# 
35 @# now do a restore
36 @#
37 @output tmp/log2.out
38 restore where=${cwd}/tmp/bacula-restores select storage=File
39 unmark *
40 mark *
41 done
42 yes
43 wait
44 messages
45 @output
46 quit
47 END_OF_DATA
48 scripts/check_for_zombie_jobs storage=File
49 bin/bacula stop  2>&1 >/dev/null
50 grep "^  Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
51 bstat=$?
52 grep "^  Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
53 rstat=$?
54 diff tmp/largefile  tmp/bacula-restores${cwd}/tmp/largefile 2>&1 >/dev/null
55 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
56    echo " "
57    echo " "
58    echo "  !!!!! six-vol-test Bacula source failed!!! !!!!! "
59    echo "  !!!!! six-vol-test failed!!! !!!!! " >>test.out
60    if [ $bstat != 0 -o $rstat != 0 ] ; then
61       echo "  !!!!! Bad Job termination status     !!!!! "
62       echo "  !!!!! Bad Job termination status     !!!!! " >>test.out
63    else
64       echo "  !!!!! Restored files differ          !!!!! "
65       echo "  !!!!! Restored files differ          !!!!! " >>test.out
66    fi
67    echo " "
68 else
69    echo "  ===== six-vol-test Bacula source OK ===== "
70    echo "  ===== six-vol-test OK ===== " >>test.out
71    scripts/cleanup
72 fi