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