]> git.sur5r.net Git - bacula/bacula/blob - regress/regress/tests/weird-files-test
Copy trunk regress into Branch-2.2
[bacula/bacula] / regress / 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 @$out
58 quit
59 END_OF_DATA
60
61 run_bacula
62 check_for_zombie_jobs storage=File 
63 stop_bacula
64 # Note, the Unix domain socket (sock-file) is not restored
65 #  by Bacula so we delete it for the diffs
66 rm -f weird-files/sock-file
67 touch weird-files tmp/bacula-restores${cwd}/weird-files
68
69 ${cwd}/bin/testls weird-files | sort >${cwd}/tmp/original
70 cd tmp/bacula-restores${cwd}
71 ${cwd}/bin/testls weird-files | sort >${cwd}/tmp/restored
72 cd ${cwd}
73
74 check_two_logs
75 #diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
76 diff ${cwd}/tmp/original ${cwd}/tmp/restored                
77 dstat=$?
78 end_test