]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/auto-label-test
New configure
[bacula/bacula] / regress / tests / auto-label-test
1 #!/bin/sh
2 #
3 #  Test if Bacula can automatically create a Volume label.
4 #
5 cwd=`pwd`
6 scripts/copy-test-confs
7 scripts/cleanup
8 echo "${cwd}/build" >/tmp/file-list
9
10 cp ${cwd}/bin/bacula-dir.conf ${cwd}/tmp/1
11 sed "s%# Label Format%  Label Format%" ${cwd}/tmp/1 >${cwd}/bin/bacula-dir.conf
12
13 echo " "
14 echo " "
15 echo " === Starting auto-label-test ==="
16 echo " === Starting auto-label-test ===" >>working/log
17 echo " "
18
19 bin/bacula start 2>&1 >/dev/null
20 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
21 @output /dev/null
22 status all
23 status all
24 list pools
25 messages
26 @output tmp/log1.out
27 run job=CompressedTest storage=File yes
28 list pools
29 list volumes
30 wait
31 messages
32 @# 
33 @# now do a restore
34 @#
35 @output tmp/log2.out
36 restore where=${cwd}/tmp/bacula-restores select storage=File
37 unmark *
38 mark *
39 done
40 yes
41 wait
42 messages
43 @output
44 quit
45 END_OF_DATA
46 scripts/check_for_zombie_jobs storage=File
47
48 bin/bacula stop 2>&1 >/dev/null
49 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
50 bstat=$?
51 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
52 rstat=$?
53 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
54 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
55    echo " "
56    echo " "
57    echo "  !!!!! auto-label-test failed!!! !!!!! "
58    echo "  !!!!! auto-label-test failed!!! !!!!! " >>test.out
59    echo " "
60 else
61    echo "  ===== auto-label-test OK ===== "
62    echo "  ===== auto-label-test OK ===== " >>test.out
63    scripts/cleanup
64 fi