]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/win32-to-linux-tape
Updates
[bacula/bacula] / regress / tests / win32-to-linux-tape
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory 
4 #   to a tape then restore it, we do that twice to ensure that
5 #   we can correctly append to a tape.
6 #
7 debug=1
8 if test "$debug" -eq 1 ; then
9   out="tee"
10 else
11   out="output"
12 fi
13
14 cwd=`pwd`
15 scripts/copy-win32-confs
16 scripts/cleanup-tape
17
18 echo "${cwd}/build" >/tmp/file-list
19
20 echo " "
21 echo " "
22 echo " === Starting Win32 Backup tape test at `date +%R:%S` ==="
23 echo " === Starting Win32 Backup tape test at `date +%R:%S` ===" >>working/log
24 echo " "
25
26 cat <<END_OF_DATA >tmp/bconcmds
27 @output /dev/null
28 messages
29 @$out tmp/log1.out
30 label storage=DDS-4 volume=TestVolume001 slot=0 pool=Default drive=0
31 run job=NightlySave yes
32 @sleep 10
33 status storage=DDS-4
34 @sleep 30
35 messages
36 wait
37 messages
38 @# 
39 @# now do a restore
40 @#
41 @$out tmp/log2.out
42 restore where=c:/tmp/bacula-restores client=Tibs select all storage=DDS-4 done
43 yes
44 wait
45 messages
46 END_OF_DATA
47 if test "$debug" -eq 1 ; then
48   bin/bacula start
49   cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
50 else
51   bin/bacula start 2>&1 >/dev/null
52   cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf  2>&1 >/dev/null
53 fi
54
55 scripts/check_for_zombie_jobs storage=DDS-4
56
57 bin/bacula stop 2>&1 >/dev/null
58 grep "^  Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
59 bstat=$?
60 grep "^  Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
61 rstat=$?
62 if [ $bstat != 0 -o $rstat != 0 ] ; then
63    echo " "
64    echo " "
65    echo "  !!!!! Win32 Backup tape test failed!!! !!!!! "
66    echo "  !!!!! Win32 Backup tape test failed!!! !!!!! " >>test.out
67    echo " "
68 else
69    echo "  ===== Win32 Backup tape test OK ===== "
70    echo "  ===== Win32 Backup tape test OK ===== " >>test.out
71 #  scripts/cleanup
72 fi