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