]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/exclude-dir-test
7cea3dc7c2fb4cdd3bc2a9e020c51665807e5aed
[bacula/bacula] / regress / tests / exclude-dir-test
1 #!/bin/sh
2 #
3 # Run a simple backup of the Bacula build directory using the compressed option
4 #   then backup a second time and finally restore it
5 #
6 TestName="exclude-dir-test"
7 JobName=exclude-dir
8 . scripts/functions
9
10 cwd=`pwd`
11 scripts/cleanup
12 scripts/copy-test-confs
13 echo "${cwd}/build" >${cwd}/tmp/file-list
14 sed 's/Include {/Include { Exclude Dir Containing = ".nobkp"/' $conf/bacula-dir.conf > $tmp/1
15 cp -f $tmp/1 $conf/bacula-dir.conf
16 change_jobname CompressedTest $JobName
17 start_test
18
19 mkdir ${cwd}/build/src/testdir
20 touch ${cwd}/build/src/testdir/.nobkp
21 cp ${cwd}/build/src/dird/*.c ${cwd}/build/src/testdir
22
23 cat >tmp/bconcmds <<END_OF_DATA
24 @$out /dev/null
25 messages
26 @$out $tmp/log3.out
27 estimate job=$JobName listing
28 messages
29 @$out $tmp/log1.out
30 label storage=File volume=TestVolume001
31 run job=$JobName yes
32 wait
33 messages
34 @$out $tmp/log2.out
35 restore where=${cwd}/tmp/bacula-restores select all storage=File done
36 yes
37 wait
38 messages
39 quit
40 END_OF_DATA
41
42 run_bacula
43 check_for_zombie_jobs storage=File 
44 stop_bacula
45
46 check_two_logs
47
48 # should be ok if we remove the testdir
49 rm -rf ${cwd}/build/src/testdir
50 check_restore_diff
51
52 grep '/testdir' $tmp/log3.out > /dev/null
53 if [ $? = 0 ]; then
54     print_debug "ERROR: Should not see testdir in estimate output"
55     bstat=2
56 fi
57
58 end_test