]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/weird-files2-test
Update
[bacula/bacula] / regress / tests / weird-files2-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory
4 #   then restore it.
5 #
6 TestName="weird-files2-test"
7 JobName=weird-files2
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 cwd=`pwd`
16 scripts/cleanup
17 scripts/copy-test-confs
18 rm -rf weird-files2
19 cp -Rp weird-files weird-files2
20 echo "${cwd}/weird-files2" >${cwd}/tmp/file-list
21 cd weird-files2
22 #perl socket.pl     # we no longer restore sockets
23 cd ..
24
25 change_jobname NightlySave $JobName
26 start_test
27
28 bin/testls weird-files2 | grep -v sock-file >${cwd}/tmp/original
29
30 cat <<END_OF_DATA >tmp/bconcmds
31 @$out /dev/null
32 messages
33 @$out tmp/log1.out
34 label storage=File volume=TestVolume001
35 run job=$JobName yes
36 wait
37 messages
38 @$out
39 quit
40 END_OF_DATA
41
42 run_bacula
43 check_for_zombie_jobs storage=File 
44 #
45 # Now mess up the a hard link, and a soft link
46 #
47 cd weird-files2
48 rm -f hard-file2
49 ln hard-file3 hard-file2
50 rm -f soft-file2
51 ln -s soft-file3 soft-file2
52 cd ${cwd}
53 cat <<END_OF_DATA >tmp/bconcmds
54 @$out /dev/null
55 messages
56 @# 
57 @# now do a restore
58 @#
59 @$out tmp/log2.out
60 restore where= storage=File
61 5
62 unmark *
63 mark *
64 done
65 yes
66 wait
67 messages
68 @$out
69 quit
70 END_OF_DATA
71
72 run_bconsole
73 check_for_zombie_jobs storage=File 
74 stop_bacula
75
76 bin/testls weird-files2 >${cwd}/tmp/restored
77
78 check_two_logs
79 diff -u ${cwd}/tmp/original ${cwd}/tmp/restored 2>&1 >/dev/null
80 #diff -u ${cwd}/tmp/original ${cwd}/tmp/restored
81 dstat=$?
82
83 end_test