]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/hardlink-test
ebl fix more pool problem
[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 pool=Default
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 @$out
55 quit
56 END_OF_DATA
57
58 run_bacula
59 check_for_zombie_jobs storage=File 
60 stop_bacula
61
62 check_two_logs
63 diff ${cwd}/weird-files/subdir/another-hardlink \
64   ${cwd}/tmp/bacula-restores/${cwd}/weird-files/subdir/another-hardlink 2>&1 >/dev/null
65 dstat=$?
66 end_test