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