]> git.sur5r.net Git - bacula/bacula/blob - regress/tests/backup-to-null
Big backport from Enterprise
[bacula/bacula] / regress / tests / backup-to-null
1 #!/bin/sh
2 #
3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
5 #
6 # Run a simple backup of the Bacula build directory 
7 #   to /dev/null Of course, it's not possible to restore ;-)
8 #
9 TestName="backup-to-null"
10 JobName=backuptonull
11
12
13 . scripts/functions
14
15 # Not compatible with a backup to /dev/null
16 unset FORCE_DEDUP
17 unset FORCE_ALIGNED
18 unset FORCE_CLOUD
19
20 scripts/cleanup
21 scripts/copy-fifo-confs
22
23 echo "${cwd}/build" >${cwd}/tmp/file-list
24
25 change_jobname NightlySave $JobName
26 rm -f ${cwd}/tmp/log1.out ${cwd}/tmp/log2.out
27 start_test
28
29
30 # Write out bconsole commands
31 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
32 @$out /dev/null
33 messages
34 @$out ${cwd}/tmp/log1.out
35 @#setdebug level=200 storage=Dummy
36 label storage=Dummy volume=TestVolume001 slot=0 pool=Default
37 run job=$JobName yes
38 status storage=Dummy
39 @sleep 1
40 wait
41 @sleep 3
42 messages
43 quit
44 END_OF_DATA
45
46 run_bacula
47 check_for_zombie_jobs storage=Dummy
48 stop_bacula
49
50 #
51 # Now do a second backup after making a few changes
52 #
53 touch ${cwd}/build/src/dird/*.c
54 echo "test test" > ${cwd}/build/src/dird/xxx
55
56 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
57 @$out /dev/null
58 messages
59 @$out ${cwd}/tmp/log2.out
60 list volumes
61 run job=$JobName yes
62 wait
63 list volumes
64 @sleep 3
65 messages
66 quit
67 END_OF_DATA
68
69 run_bacula
70 check_for_zombie_jobs storage=Dummy
71 stop_bacula
72
73 grep "^  Termination: *Backup OK" ${cwd}/tmp/log1.out 2>&1 >/dev/null
74 bstat=$?
75 grep "^  Termination: *Backup OK" ${cwd}/tmp/log2.out 2>&1 >/dev/null
76 dstat=$?
77
78 # not yet implemented
79 rstat=0
80
81 end_test