]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/backup-win32-tape
Add win32 test
[bacula/bacula] / regress / tests / backup-win32-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 cwd=`pwd`
8 scripts/copy-win32-confs
9 scripts/cleanup-tape
10
11 echo "${cwd}/build" >/tmp/file-list
12
13 echo " "
14 echo " "
15 echo " === Starting Backup Win32 tape test at `date +%R:%S` ==="
16 echo " === Starting Backup Win32 tape test at `date +%R:%S` ===" >>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 messages
23 @tee tmp/log1.out
24 label storage=DDS-4 volume=TestVolume001 slot=0
25 run job=NightlySave yes
26 @sleep 10
27 status storage=DDS-4
28 wait
29 messages
30 @# 
31 @# now do a restore
32 @#
33 @#output tmp/log2.out
34 @#restore where=${cwd}/tmp/bacula-restores select all storage=DDS-4 done
35 @#yes
36 @#wait
37 @#messages
38 END_OF_DATA
39 scripts/check_for_zombie_jobs storage=DDS-4
40
41 bin/bacula stop 2>&1 >/dev/null
42 grep "^  Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
43 bstat=$?
44 if [ $bstat != 0 ] ; then
45    echo " "
46    echo " "
47    echo "  !!!!! Backup Win32 tape test failed!!! !!!!! "
48    echo "  !!!!! Backup Win32 tape test failed!!! !!!!! " >>test.out
49    echo " "
50 else
51    echo "  ===== Backup Win32 tape test OK ===== "
52    echo "  ===== Backup Win32 tape test OK ===== " >>test.out
53    scripts/cleanup
54 fi