]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/strip-test
Use tmp instead of /tmp + fix strip-test so diff works
[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 @$out
60 quit
61 END_OF_DATA
62
63 run_bconsole
64
65 check_for_zombie_jobs storage=FileStorage
66 stop_bacula
67
68 check_two_logs
69 #
70 if test "$debug" -eq 1 ; then
71    diff -ur ${tmp}/$$-strip/ ${tmp}/bacula-restores/${rpath}
72 else 
73    diff -r ${tmp}/$$-strip/ ${tmp}/bacula-restores/${rpath} 2>&1 >/dev/null
74 fi
75 dstat=$?
76
77 rm -rf ${tmp}/$$-strip
78
79 end_test