]> 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 bin/bacula stop 2>&1 >/dev/null
23 cd bin
24 ./drop_bacula_tables >/dev/null 2>&1
25 ./make_bacula_tables >/dev/null 2>&1
26 ./grant_bacula_privileges 2>&1 >/dev/null
27 cd ..
28
29 echo " "
30 echo " "
31 echo " === Starting weird filenames test ==="
32 echo " === Starting weird filenames test ===" >>working/log
33 echo " "
34
35 # bin/bacula start 2>&1 >/dev/null
36 bin/bacula start
37 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
38 @output /dev/null
39 messages
40 @output tmp/log1.out
41 label storage=File
42 TestVolume001
43 run job=NightlySave
44 yes
45 wait
46 messages
47 @# 
48 @# now do a restore
49 @#
50 @output tmp/log2.out
51 restore where=${cwd}/tmp/bacula-restores select all storage=File done
52 yes
53 wait
54 messages
55 @output
56 quit
57 END_OF_DATA
58 scripts/check_for_zombie_jobs storage=File 
59 bin/bacula stop 2>&1 >/dev/null
60 ${cwd}/bin/testls weird-files | sort >${cwd}/tmp/original
61 cd tmp/bacula-restores${cwd}
62 ${cwd}/bin/testls weird-files | sort >${cwd}/tmp/restored
63 cd ${cwd}
64 grep "^Termination: *Backup OK" tmp/log1.out 2>&1 >/dev/null
65 bstat=$?
66 grep "^Termination: *Restore OK" tmp/log2.out 2>&1 >/dev/null
67 rstat=$?
68 diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
69 if [ $? != 0 -o $bstat != 0 -o $rstat != 0 ] ; then
70    echo " "
71    echo " "
72    echo "  !!!!! Weird files test failed!!! !!!!! "
73    echo "  !!!!! Weird files test failed!!! !!!!! " >>test.out
74    echo " "
75 else
76    echo "  ===== Weird files test OK ===== "
77    echo "  ===== Weird files test OK ===== " >>test.out
78    cd ${cwd}
79    scripts/cleanup
80 fi