]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/weird-files-test
Fix regression on Solaris.
[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 TestName="weird-files-test"
7 JobName=wierd-files
8 . scripts/functions
9
10 if test ! -d weird-files ; then
11    echo " "
12    echo "Weird files not configured. Test not run."
13    exit 0
14 fi
15
16 cwd=`pwd`
17 scripts/cleanup
18 scripts/copy-test-confs
19 change_jobname NightlySave $JobName
20 #
21 # Note, we save the weird-files directory twice on purpose
22 #  because this causes problems with hard linked files 
23 #  that are only saved once.  In 1.33, Bacula now deals
24 #  with this situation.
25 #
26 echo "${cwd}/weird-files" >${cwd}/tmp/file-list
27 echo "${cwd}/weird-files" >>${cwd}/tmp/file-list
28
29 # Create a Unix domain socket (sock-file)
30 cd weird-files
31 perl socket.pl
32 cd ..
33
34 start_test
35
36 cat <<END_OF_DATA >tmp/bconcmds
37 @$out /dev/null
38 messages
39 @$out tmp/log1.out
40 label storage=File
41 TestVolume001
42 run job=$JobName    
43 yes
44 wait
45 messages
46 @# 
47 @# now do a restore
48 @#
49 @$out tmp/log2.out
50 restore where=${cwd}/tmp/bacula-restores select storage=File
51 unmark *
52 mark *
53 done
54 yes
55 wait
56 messages
57 quit
58 END_OF_DATA
59
60 run_bacula
61 check_for_zombie_jobs storage=File 
62 stop_bacula
63
64 # Note, the Unix domain socket (sock-file) is not restored
65 #  by Bacula so we delete it for the diffs. diff.pl already discards them
66 # rm -f weird-files/sock-file
67
68 # to have the same mtime after the rm, we need to touch directories
69 # touch weird-files tmp/bacula-restores${cwd}/weird-files
70
71
72 $rscripts/diff.pl -s weird-files -d tmp/bacula-restores${cwd}/weird-files > tmp/diff.out
73 dstat=$?
74
75 check_two_logs
76 if test "$debug" -eq 1; then
77   cat tmp/diff.out
78 fi
79 end_test