]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/restart-sd-test
Make out of freespace non-fatal for removable devices -- i.e. behaves like tape
[bacula/bacula] / regress / tests / restart-sd-test
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6 # Run a backup of the build directory and check that it restarts correctly.
7 #
8 TestName="restart-sd-test"
9 JobName=RestartSD
10 . scripts/functions
11
12 scripts/cleanup
13 scripts/copy-test-confs
14
15 setup_shstore # simulate shared storage if enabled
16
17 echo "${cwd}/build" >${cwd}/tmp/file-list
18
19 change_jobname NightlySave $JobName
20 start_test
21
22 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
23 @output /dev/null
24 messages
25 @$out ${cwd}/tmp/log3.out
26 setbandwidth limit="1000 kb/s" client
27 @#setdebug level=20 dir
28 label storage=File volume=TestVolume001 slot=1 drive=0
29 run job=$JobName yes
30 @sleep 10
31 messages
32 quit
33 END_OF_DATA
34
35 run_bacula  
36
37 pid=`cat $working/bacula-sd.*.pid`
38 if ps $pid | grep bacula-sd > /dev/null; then
39     kill -9 $pid
40 else
41     print_debug "ERROR: Unable to find bacula-sd pid, please review the script"
42     stop_bacula
43     end_test
44     exit 1
45 fi
46
47 sleep 5
48
49 $scripts/bacula-ctl-sd start
50
51 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
52 @$out ${cwd}/tmp/log3.out
53 messages
54 cancel all yes
55 wait
56 messages
57 @$out ${cwd}/tmp/log1.out
58 setbandwidth limit="10000000 kb/s" client
59 run job=$JobName yes
60 wait
61 messages
62 @$out ${cwd}/tmp/log2.out
63 restore where=$tmp/bacula-restores storage=File select all done
64 yes
65 wait
66 messages
67 quit
68 END_OF_DATA
69
70 run_bconsole
71 scripts/check_for_zombie_jobs storage=File
72 stop_bacula
73
74 check_two_logs
75 check_restore_diff
76 end_test