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