]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/weird-files-test
Final changes
[bacula/bacula] / regress / tests / weird-files-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory
4 #   then restore it.
5 #
6 if test ! -d weird-files ; then
7    echo " "
8    echo "Weird files not configured. Test not run."
9    exit 0
10 fi
11 cwd=`pwd`
12 scripts/copy-test-confs
13 scripts/cleanup
14 #
15 # Note, we save the weird-files directory twice on purpose
16 #  because this causes problems with hard linked files 
17 #  that are only saved once.  In 1.33, Bacula now deals
18 #  with this situation.
19 #
20 echo "${cwd}/weird-files" >/tmp/file-list
21 echo "${cwd}/weird-files" >>/tmp/file-list
22
23 echo " "
24 echo " "
25 echo " === Starting weird filenames test ==="
26 echo " === Starting weird filenames test ===" >>working/log
27 echo " "
28
29 bin/bacula start 2>&1 >/dev/null
30 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
31 @output /dev/null
32 messages
33 @output tmp/log1.out
34 label storage=File
35 TestVolume001
36 run job=NightlySave
37 yes
38 wait
39 messages
40 @# 
41 @# now do a restore
42 @#
43 @output tmp/log2.out
44 restore where=${cwd}/tmp/bacula-restores select storage=File
45 unmark *
46 mark *
47 done
48 yes
49 wait
50 messages
51 @output
52 quit
53 END_OF_DATA
54 scripts/check_for_zombie_jobs storage=File 
55 bin/bacula stop 2>&1 >/dev/null
56 ${cwd}/bin/testls weird-files | sort >${cwd}/tmp/original
57 cd tmp/bacula-restores${cwd}
58 ${cwd}/bin/testls weird-files | sort >${cwd}/tmp/restored
59 cd ${cwd}
60 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
61 bstat=$?
62 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
63 rstat=$?
64 diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
65 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
66    echo " "
67    echo " "
68    echo "  !!!!! Weird files test failed!!! !!!!! "
69    echo "  !!!!! Weird files test failed!!! !!!!! " >>test.out
70    if [ $bstat != 0 -o $rstat != 0 ] ; then
71       echo "  !!!!! Bad Job termination status     !!!!! "
72       echo "  !!!!! Bad Job termination status     !!!!! " >>test.out
73    else
74       echo "  !!!!! Restored files differ          !!!!! "
75       echo "  !!!!! Restored files differ          !!!!! " >>test.out
76    fi
77    echo " "
78 else
79    echo "  ===== Weird files test OK ===== "
80    echo "  ===== Weird files test OK ===== " >>test.out
81    cd ${cwd}
82    scripts/cleanup
83 fi