]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/six-vol-test
d1a012e26d0a429dceeaba74f5881c93b7aa27f6
[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
30 bin/console -c bin/console.conf <<END_OF_DATA
31 messages
32 @output
33 run job=MultiVol storage=File
34 yes
35 wait
36 messages
37 @# 
38 @# now do a restore
39 @#
40 restore where=${cwd}/tmp/bacula-restores
41 5
42 done
43 yes
44 wait
45 messages
46 quit
47 END_OF_DATA
48 bin/bacula stop
49 diff tmp/largefile  tmp/bacula-restores${cwd}/tmp/largefile
50 if [ $? != 0 ] ; then
51    echo " "
52    echo " "
53    echo "  ===== six-vol-test Bacula source failed!!! ===== "
54    echo "  ===== six-vol-test failed!!! ===== " >>test.out
55    echo " "
56 else
57    echo "  ===== six-vol-test Bacula source OK ===== "
58    echo "  ===== six-vol-test OK ===== " >>test.out
59    scripts/cleanup
60 fi