]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/restore-replace-never-test
regress: Add test to do more than max reloads
[bacula/bacula] / regress / tests / restore-replace-never-test
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6
7 #
8 # Run a simple backup of the Bacula build directory using the compressed option
9 #   then restore it.
10 #
11
12 TestName="restore-replace-never"
13 JobName=restore-replace-never
14 . scripts/functions
15
16 scripts/cleanup
17 scripts/copy-test-confs
18
19 mkdir -p ${cwd}/tmp/dir/dir1
20
21 # use non usual rights to compare
22 chmod 711 ${cwd}/tmp/dir/dir1
23 GRP=`id -G`                     # should display the group list
24 set $GRP                        # affect $1, $2 to this list
25 chgrp $2 ${cwd}/tmp/dir/dir1    # the first one is the default, choose the 2nd
26
27 touch ${cwd}/tmp/dir/dir1/file1
28 touch ${cwd}/tmp/dir/dir1/file2
29 echo ${cwd}/tmp/dir >${cwd}/tmp/file-list
30
31 change_jobname CompressedTest $JobName
32 start_test
33
34 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
35 @output /dev/null
36 messages
37 @$out ${cwd}/tmp/log1.out
38 label storage=File volume=TestVolume001
39 run job=$JobName yes
40 wait
41 messages
42 quit
43 END_OF_DATA
44
45 run_bacula
46
47 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
48 @output /dev/null
49 messages
50 @$out ${cwd}/tmp/log2.out
51 restore where=$cwd/tmp storage=File replace=never select all done yes
52 @#restore storage=File select all done yes
53 wait
54 messages
55 quit
56 END_OF_DATA
57
58 run_bconsole
59
60 check_for_zombie_jobs storage=File
61 stop_bacula
62
63 check_two_logs
64
65 scripts/diff.pl -s ${cwd}/tmp/dir -d ${cwd}/tmp/$cwd/tmp/dir
66 if [ $? != 0 ]; then
67   dstat=1
68 fi
69 end_test