]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/hardlink-test
regress: Add more complex systemstate test with full restore
[bacula/bacula] / regress / tests / hardlink-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory
4 #   then restore it.
5 #
6 TestName="hardlink-test"
7 JobName=hardlink
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 start_test
30
31 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
32 @$out /dev/null
33 messages
34 @$out ${cwd}/tmp/log1.out
35 label storage=File
36 TestVolume001
37 run job=$JobName    
38 yes
39 wait
40 messages
41 @# 
42 @# now do a restore
43 @#
44 @$out ${cwd}/tmp/log2.out
45 setdebug level=200 client=localhost-fd
46 restore where=${cwd}/tmp/bacula-restores storage=File
47 5
48 cd ${cwd}/weird-files/subdir
49 mark another-hardlink      
50 done
51 yes
52 wait
53 messages
54 quit
55 END_OF_DATA
56
57 run_bacula
58 check_for_zombie_jobs storage=File 
59 stop_bacula
60
61 check_two_logs
62 diff ${cwd}/weird-files/subdir/another-hardlink \
63   ${cwd}/tmp/bacula-restores/${cwd}/weird-files/subdir/another-hardlink 2>&1 >/dev/null
64 dstat=$?
65 end_test