]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/weird-files-test
Updates
[bacula/bacula] / regress / tests / weird-files-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory
4 #   then restore it.
5 #
6 TestName="weird-files-test"
7 JobName=wierd-files
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 select storage=File
47 unmark *
48 mark *
49 done
50 yes
51 wait
52 messages
53 @$out
54 quit
55 END_OF_DATA
56
57 run_bacula
58 check_for_zombie_jobs storage=File 
59 stop_bacula
60
61 ${cwd}/bin/testls weird-files | sort >${cwd}/tmp/original
62 cd tmp/bacula-restores${cwd}
63 ${cwd}/bin/testls weird-files | sort >${cwd}/tmp/restored
64 cd ${cwd}
65
66 check_two_logs
67 diff ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
68 dstat=$?
69 end_test