]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/strip-test
Verify if the Exclude Dir Containing directive does his job
[bacula/bacula] / regress / tests / strip-test
1 #!/bin/sh
2 #
3 # Attempt to strip the path
4 #
5 TestName="strip-test"
6 JobName=stripTest
7 . scripts/functions
8
9 scripts/cleanup
10 scripts/copy-strip-confs
11
12
13 # Make a copy of build/src/dird to be backed up
14 rm -rf ${tmp}/$$-strip
15 mkdir ${tmp}/$$-strip
16 cp -rpf ${cwd}/build/src/dird/ ${tmp}/$$-strip/
17 echo "${tmp}/$$-strip" >${cwd}/tmp/file-list
18
19 # Now, strip the first 4 parts of the path (which is what
20 #   the backup will do and put the result in rpath
21 echo "${tmp}/$$-strip/" >${tmp}/1
22 rpath=`cut -f5- -d'/' ${tmp}/1`
23 echo "========= $rpath"
24
25 change_jobname NightlySave $JobName
26 start_test
27
28 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
29 @$out /dev/null
30 messages
31 @$out ${cwd}/tmp/log1.out
32 @#setdebug level=150 dir
33 @#setdebug level=150 storage=FileStorage
34 setdebug level=100 client=$CLIENT
35 label storage=FileStorage pool=Default volume=TestVolume001
36 run job=$JobName storage=FileStorage pool=Default yes
37 wait
38 messages
39 quit
40 END_OF_DATA
41
42
43 run_bacula
44
45 rm -rf ${cwd}/tmp/bacula-restores
46
47 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
48 @$out /dev/null
49 messages
50 @# 
51 @# now do a restore
52 @#
53 @$out ${cwd}/tmp/log2.out
54 @#setdebug level=50 client=$CLIENT
55 restore where=${cwd}/tmp/bacula-restores select all storage=FileStorage done
56 yes
57 wait
58 messages
59 quit
60 END_OF_DATA
61
62 run_bconsole
63
64 check_for_zombie_jobs storage=FileStorage
65 stop_bacula
66
67 check_two_logs
68 #
69 if test "$debug" -eq 1 ; then
70    diff -ur ${tmp}/$$-strip/ ${tmp}/bacula-restores/${rpath}
71 else 
72    diff -r ${tmp}/$$-strip/ ${tmp}/bacula-restores/${rpath} 2>&1 >/dev/null
73 fi
74 dstat=$?
75
76 rm -rf ${tmp}/$$-strip
77
78 end_test