3 # Run a simple backup of the Bacula build directory
7 if test "$debug" -eq 1 ; then
12 if test ! -d weird-files ; then
14 echo "Weird files not configured. Test not run."
18 scripts/copy-test-confs
21 # Note, we save the weird-files directory twice on purpose
22 # because this causes problems with hard linked files
23 # that are only saved once. In 1.33, Bacula now deals
24 # with this situation.
26 echo "${cwd}/weird-files" >/tmp/file-list
27 echo "${cwd}/weird-files" >>/tmp/file-list
31 echo " === Starting weird filenames test at `date +%R:%S` ==="
32 echo " === Starting weird filenames test at `date +%R:%S` ===" >>working/log
35 cat <<END_OF_DATA >tmp/bconcmds
49 restore where=${cwd}/tmp/bacula-restores select storage=File
59 if test "$debug" -eq 1 ; then
61 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
63 bin/bacula start 2>&1 >/dev/null
64 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
66 scripts/check_for_zombie_jobs storage=File
67 bin/bacula stop 2>&1 >/dev/null
68 ${cwd}/bin/testls weird-files | sort >${cwd}/tmp/original
69 cd tmp/bacula-restores${cwd}
70 ${cwd}/bin/testls weird-files | sort >${cwd}/tmp/restored
72 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
74 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
76 diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
77 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
80 echo " !!!!! Weird files test failed!!! !!!!! "
81 echo " !!!!! Weird files test failed!!! !!!!! " >>test.out
82 if [ $bstat != 0 -o $rstat != 0 ] ; then
83 echo " !!!!! Bad Job termination status !!!!! "
84 echo " !!!!! Bad Job termination status !!!!! " >>test.out
86 echo " !!!!! Restored files differ !!!!! "
87 echo " !!!!! Restored files differ !!!!! " >>test.out
91 echo " ===== Weird files test OK ===== "
92 echo " ===== Weird files test OK ===== " >>test.out