]> git.sur5r.net Git - bacula/bacula/blob - regress/win32/tests/hardlink-test
Final changes
[bacula/bacula] / regress / win32 / 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 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 start_test
31
32 cat <<END_OF_DATA >tmp/bconcmds
33 @$out /dev/null
34 messages
35 @$out tmp/log1.out
36 label storage=File
37 TestVolume001
38 run job=$JobName    
39 yes
40 wait
41 messages
42 @# 
43 @# now do a restore
44 @#
45 @$out tmp/log2.out
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