]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/weird-files2-test
ec328155dd92000853b5c5361045f0a477c31b03
[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
23 change_jobname NightlySave $JobName
24 start_test
25
26 bin/testls weird-files2 >${cwd}/tmp/original
27
28 cat <<END_OF_DATA >tmp/bconcmds
29 @$out /dev/null
30 messages
31 @$out tmp/log1.out
32 label storage=File volume=TestVolume001
33 run job=$JobName yes
34 wait
35 messages
36 @$out
37 quit
38 END_OF_DATA
39
40 run_bacula
41 check_for_zombie_jobs storage=File 
42 #
43 # Now mess up the a hard link, and a soft link
44 #
45 cd weird-files2
46 rm -f hard-file2
47 ln hard-file3 hard-file2
48 rm -f soft-file2
49 ln -s soft-file3 soft-file2
50 cd ${cwd}
51 cat <<END_OF_DATA >tmp/bconcmds
52 @$out /dev/null
53 messages
54 @# 
55 @# now do a restore
56 @#
57 @$out tmp/log2.out
58 restore where= storage=File
59 5
60 unmark *
61 mark *
62 done
63 yes
64 wait
65 messages
66 @$out
67 quit
68 END_OF_DATA
69
70 run_bconsole
71 check_for_zombie_jobs storage=File 
72 stop_bacula
73
74 bin/testls weird-files2 >${cwd}/tmp/restored
75
76 check_two_logs
77 diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
78 dstat=$?
79
80 end_test