]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/encrypt-bug-test
Make out of freespace non-fatal for removable devices -- i.e. behaves like tape
[bacula/bacula] / regress / tests / encrypt-bug-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 untitled15.jpg that fails to
9 #  restore properly in bug #763 
10 #
11 TestName="encrypt-bug-test"
12 JobName=Crypto-bug
13 . scripts/functions
14
15 scripts/cleanup
16 scripts/copy-crypto-confs
17 echo "${cwd}/encrypt-bug.jpg"   >${cwd}/tmp/file-list
18 echo "${cwd}/encrypt-bug.jpg"   >${cwd}/tmp/restore-list
19 echo "${cwd}/encrypt-bug.txt"  >>${cwd}/tmp/file-list
20 echo "${cwd}/encrypt-bug.txt"  >>${cwd}/tmp/restore-list
21 echo "${cwd}/encrypt-bug2.txt" >>${cwd}/tmp/file-list
22 echo "${cwd}/encrypt-bug2.txt" >>${cwd}/tmp/restore-list
23 files="encrypt-bug.jpg encrypt-bug.txt encrypt-bug2.txt"
24 mkdir -p ${cwd}/tmp/build
25 for i in ${files}; do
26    cp -p ${cwd}/encrypt-bug*.* ${cwd}/tmp/build
27 done
28
29 change_jobname NightlySave $JobName
30 start_test
31
32 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
33 @output /dev/null
34 messages
35 @$out ${cwd}/tmp/log1.out
36 label storage=File volume=TestVolume001
37 setdebug level=100 fd
38 run job=$JobName yes
39 wait
40 messages
41 @# 
42 @# now do a restore
43 @#
44 @$out ${cwd}/tmp/log2.out
45 setdebug level=100 fd
46 restore where=${cwd}/tmp/bacula-restores storage=File
47 5
48 mark *
49 done
50 yes
51 wait
52 messages
53 quit
54 END_OF_DATA
55
56 run_bacula
57 sleep 2
58 check_for_zombie_jobs storage=File 
59 stop_bacula
60
61 #du -s build
62 #du -s ${cwd}/tmp/bacula-restores/
63
64 check_two_logs
65 diff ${cwd}/tmp/build ${cwd}/tmp/bacula-restores/${cwd} 2>&1 >/dev/null
66 dstat=$?
67 end_test