3 # Run a simple backup of the Bacula build directory
6 if test ! -d weird-files ; then
8 echo "weird files not configured. Test not run."
12 scripts/copy-test-confs
15 cp -Rp weird-files weird-files2
16 echo "${cwd}/weird-files2" >/tmp/file-list
17 bin/bacula stop 2>&1 >/dev/null
19 ./drop_bacula_tables >/dev/null 2>&1
20 ./make_bacula_tables >/dev/null 2>&1
21 ./grant_bacula_privileges 2>&1 >/dev/null
26 echo " === Starting weird filenames2 test ==="
27 echo " === Starting weird filenames2 test ===" >>working/log
30 bin/testls weird-files2 >${cwd}/tmp/original
31 bin/bacula start 2>&1 >/dev/null
32 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
36 label storage=File volume=TestVolume001
37 run job=NightlySave yes
44 # Now mess up the a hard link, and a soft link
48 ln hard-file3 hard-file2
50 ln -s soft-file3 soft-file2
52 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
68 bin/bacula stop 2>&1 >/dev/null
69 bin/testls weird-files2 >${cwd}/tmp/restored
70 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
72 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
74 diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
75 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
78 echo " !!!!! Weird files2 test failed!!! !!!!! "
79 echo " !!!!! Weird files2 test failed!!! !!!!! " >>test.out
82 echo " ===== Weird files2 test OK ===== "
83 echo " ===== Weird files2 test OK ===== " >>test.out