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