]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/weird-files-test
Make out of freespace non-fatal for removable devices -- i.e. behaves like tape
[bacula/bacula] / regress / tests / weird-files-test
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6
7 #
8 # Run a simple backup of the Bacula build directory
9 #   then restore it.
10 #
11 TestName="weird-files-test"
12 JobName=wierd-files
13 . scripts/functions
14
15 if test ! -d weird-files ; then
16    echo " "
17    echo "Weird files not configured. Test not run."
18    exit 0
19 fi
20
21 cwd=`pwd`
22 scripts/cleanup
23 scripts/copy-test-confs
24 change_jobname NightlySave $JobName
25 #
26 # Note, we save the weird-files directory twice on purpose
27 #  because this causes problems with hard linked files 
28 #  that are only saved once.  In 1.33, Bacula now deals
29 #  with this situation.
30 #
31 echo "${cwd}/weird-files" >${cwd}/tmp/file-list
32 echo "${cwd}/weird-files" >>${cwd}/tmp/file-list
33
34 # Create a Unix domain socket (sock-file)
35 cd weird-files
36 perl socket.pl
37 cd ..
38
39 start_test
40
41 cat <<END_OF_DATA >tmp/bconcmds
42 @output /dev/null
43 messages
44 @$out tmp/log1.out
45 label storage=File
46 TestVolume001
47 run job=$JobName    
48 yes
49 wait
50 messages
51 @# 
52 @# now do a restore
53 @#
54 @$out tmp/log2.out
55 restore where=${cwd}/tmp/bacula-restores select storage=File
56 unmark *
57 mark *
58 done
59 yes
60 wait
61 messages
62 quit
63 END_OF_DATA
64
65 run_bacula
66 check_for_zombie_jobs storage=File 
67 stop_bacula
68
69 # Note, the Unix domain socket (sock-file) is not restored
70 #  by Bacula so we delete it for the diffs. diff.pl already discards them
71 # rm -f weird-files/sock-file
72
73 # to have the same mtime after the rm, we need to touch directories
74 # touch weird-files tmp/bacula-restores${cwd}/weird-files
75
76
77 $rscripts/diff.pl -s weird-files -d tmp/bacula-restores${cwd}/weird-files > tmp/diff.out
78 dstat=$?
79
80 check_two_logs
81 if test "$debug" -eq 1; then
82   cat tmp/diff.out
83 fi
84 end_test