]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/auto-label-test
Update for new job output
[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 count
40 ls *
41 dir *
42 find Makefile
43 pwd
44 lsmark
45 estimate
46 ?
47 help
48 done
49 yes
50 wait
51 messages
52 @output
53 quit
54 END_OF_DATA
55 scripts/check_for_zombie_jobs storage=File
56
57 bin/bacula stop 2>&1 >/dev/null
58 grep "\0Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
59 bstat=$?
60 grep "\0Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
61 rstat=$?
62 diff -r build tmp/bacula-restores${cwd}/build 2>&1 >/dev/null
63 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
64    echo " "
65    echo " "
66    echo "  !!!!! auto-label-test failed!!! !!!!! "
67    echo "  !!!!! auto-label-test failed!!! !!!!! " >>test.out
68    if [ $bstat != 0 -o $rstat != 0 ] ; then
69       echo "  !!!!! Bad Job termination status     !!!!! "
70       echo "  !!!!! Bad Job termination status     !!!!! " >>test.out
71    else
72       echo "  !!!!! Restored files differ          !!!!! "
73       echo "  !!!!! Restored files differ          !!!!! " >>test.out
74    fi
75    echo " "
76 else
77    echo "  ===== auto-label-test OK ===== "
78    echo "  ===== auto-label-test OK ===== " >>test.out
79    scripts/cleanup
80 fi