3 # Run a simple backup of the Bacula build directory
7 if test "$debug" -eq 1 ; then
13 if test ! -d weird-files ; then
15 echo "weird files not configured. Test not run."
19 scripts/copy-test-confs
22 cp -Rp weird-files weird-files2
23 echo "${cwd}/weird-files2" >/tmp/file-list
27 echo " === Starting weird-files2 test at `date +%R:%S` ==="
28 echo " === Starting weird-file2 test at `date +%R:%S` ===" >>working/log
31 bin/testls weird-files2 >${cwd}/tmp/original
33 cat <<END_OF_DATA >tmp/bconcmds
37 label storage=File volume=TestVolume001
38 run job=NightlySave yes
44 if test "$debug" -eq 1 ; then
46 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
48 bin/bacula start 2>&1 >/dev/null
49 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
51 scripts/check_for_zombie_jobs storage=File
53 # Now mess up the a hard link, and a soft link
57 ln hard-file3 hard-file2
59 ln -s soft-file3 soft-file2
61 cat <<END_OF_DATA >tmp/bconcmds
68 restore where= storage=File
80 if test "$debug" -eq 1 ; then
81 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf
83 cat tmp/bconcmds | bin/bconsole -c bin/bconsole.conf 2>&1 >/dev/null
85 scripts/check_for_zombie_jobs storage=File
86 bin/bacula stop 2>&1 >/dev/null
87 bin/testls weird-files2 >${cwd}/tmp/restored
88 grep "^ Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
90 grep "^ Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
92 diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
93 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
96 echo " !!!!! Weird files2 test failed!!! !!!!! "
97 echo " !!!!! Weird files2 test failed!!! !!!!! " >>test.out
98 if [ $bstat != 0 -o $rstat != 0 ] ; then
99 echo " !!!!! Bad Job termination status !!!!! "
100 echo " !!!!! Bad Job termination status !!!!! " >>test.out
102 echo " !!!!! Restored files differ !!!!! "
103 echo " !!!!! Restored files differ !!!!! " >>test.out
107 echo " ===== Weird files2 test OK ===== "
108 echo " ===== Weird files2 test OK ===== " >>test.out