]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/weird-files2-test
update
[bacula/bacula] / regress / tests / weird-files2-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory
4 #   then restore it.
5 #
6 TestName="weird-files2-test"
7 JobName=weird-files2
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 cwd=`pwd`
17 scripts/cleanup
18 scripts/copy-test-confs
19 rm -rf weird-files2
20 cp -Rp weird-files weird-files2
21 echo "${cwd}/weird-files2" >/tmp/file-list
22 cd weird-files2
23 perl socket.pl
24 cd ..
25
26 change_jobname NightlySave $JobName
27 start_test
28
29 bin/testls weird-files2 | grep -v sock-file >${cwd}/tmp/original
30
31 cat <<END_OF_DATA >tmp/bconcmds
32 @$out /dev/null
33 messages
34 @$out tmp/log1.out
35 label storage=File volume=TestVolume001
36 run job=$JobName yes
37 wait
38 messages
39 @$out
40 quit
41 END_OF_DATA
42
43 run_bacula
44 check_for_zombie_jobs storage=File 
45 #
46 # Now mess up the a hard link, and a soft link
47 #
48 cd weird-files2
49 rm -f hard-file2
50 ln hard-file3 hard-file2
51 rm -f soft-file2
52 ln -s soft-file3 soft-file2
53 cd ${cwd}
54 cat <<END_OF_DATA >tmp/bconcmds
55 @$out /dev/null
56 messages
57 @# 
58 @# now do a restore
59 @#
60 @$out tmp/log2.out
61 restore where= storage=File
62 5
63 unmark *
64 mark *
65 done
66 yes
67 wait
68 messages
69 @$out
70 quit
71 END_OF_DATA
72
73 run_bconsole
74 check_for_zombie_jobs storage=File 
75 stop_bacula
76
77 bin/testls weird-files2 >${cwd}/tmp/restored
78
79 check_two_logs
80 #diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
81 diff ${cwd}/tmp/original ${cwd}/tmp/restored
82 dstat=$?
83
84 end_test